Questions tagged [uitextposition]

A position in a text container—that is, an index into the backing string in a text-display view.

27 questions
1
vote
0 answers

How can we implement UITextPosition and UITextRange subclasses in discrete files of their own?

When creating custom UIView or UIScrollView subclasses for use with Core Text, how can we implement UITextPosition and UITextRange subclasses in discrete files of their own? We need these to implement UITextInput, UITextInputTraits and UIKeyInput…
1
vote
0 answers

word positions inside UITextView (RTL and LTR issues)

i am having really strange behavior when i try to get the rectangle frame around a word that contains charcaters from hebrew and english combined. the following code gives me a correct rectange frame if i use only english but if i use hebrew letters…
dimka87il
  • 95
  • 6
1
vote
1 answer

How do I access the properties of UITextField's selectedTextRange UITextPosition objects?

I'm trying to establish the start and end positions of a text selection of a UITextField instance, using its selectedTextRange property (as gained from the UITextInput protocol). However, I have no idea how to access the properties of the…
user577537
0
votes
0 answers

How do I stop my text from moving up with my table (CSS)?

So i'm coding up a website and i have a table that isn't in the right place. I want to move it up. For context, there's also some text underneath the table. I added margin-top: -150px; in my CSS code for my table to do this but when i did, the text…
TGB314
  • 1
  • 2
0
votes
0 answers

Gravity Center refuses to work for Text inside buttons defined in ConstraintLayout of Fragment object

I'm trying to change the Gravity of the text inside a button. Do know that the button is defined inside a ConstraintLayout as follows:
0
votes
1 answer

Why is characterRange(at: .zero) == nil?

I have a UITextView with some text that exceeds its bounds. Thus, vertical scrolling is enabled. Now I want to find the position of the first visible character. This is what I tried: let firstCharacterPosition = characterRange(at:…
Mischa
  • 15,816
  • 8
  • 59
  • 117
0
votes
1 answer

UITextInput.characterRange(at:) is off by a few pixels

After adding a tap recognizer to my UITextView subclass, I'm attempting to get the character that is being tapped: var textRecognizer: UITapGestureRecognizer! required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) …
Cœur
  • 37,241
  • 25
  • 195
  • 267
0
votes
1 answer

Positioning the cursor in an un-editable EditText on Android application

I have been reading the answers from the post How to set cursor position in EditText? I do have a specific problem in my EditText which might be the cause of the problem. In my xml layout, I define an EditText called "edit" whose inputType = none.…
i_o
  • 777
  • 9
  • 25
0
votes
1 answer

How to format UITextField with NSNumberFormatter?

Hope this helps others, since I haven't seen any similar post on the web that shows how to format a text field using NSNumberFormatter but at the same time keep the UITextField cursor position to where it should naturally be. Those, because after…
0
votes
1 answer

UITextView get previous character - (i.e character before the cursor position) (iOS7)

I can't work out how I can get the previous character that was entered. so in other words how can I get the character that is just before the cursor any where inside the UITextView. NSInteger pos = [self.textInput…
Wael
  • 489
  • 6
  • 19
0
votes
1 answer

How to add ellipsis inUITextView by the use of UITextPosition?

Is it possible to calculate the number of Visible characters in UITextView?there is possibility that the text in textview may be more or less than the size of UITextView..so I just want to truncate the last 3 visible characters and add…
user1960279
  • 494
  • 1
  • 8
  • 24
0
votes
1 answer

How to get range of characters from a tapped word UITextview

I need to get the range of characters from a tapped word from a UITextView. I have set up a UITapGestureRecognizer on my instance of UITextView *tv. I currently have a solution that can tell me the word that was tapped, as described in this…
GeorgeBuckingham
  • 195
  • 1
  • 1
  • 10
1
2