iphone - How to know the coordinates of the last character that is added to the UITextView in iPad -


I want to insert a UITextField between the text of the UITextView to provide the "fill in the blank" functionality. I know that UITextField can not be added to UITextView, so I want to add UITextField to UITextView on the UITextView Superview of the UITextFields to maintain the location.

How can I define a coordinate special character with regard to the origin of the UITextView? The textview and its super view frame are the same. Can anyone please tell me how to do this? Is there any other way to fill the functionality of the vacancy in the paragraph of the text?

You may be able to use it to help locate the characters' location.

  // characterIndex is the index of the character for which you are searching for the location NSString * string = [myTextView.text substringToIndex: characterIndex]; CGSize sizeOfString = [string size fonts: myTextView.font is restricted; ToSize: myTextView.contentSize];   

If the letter you are looking for is on the first line of the text view, size offstring will give you coordinates (offset from the height of the line).

If the character you are looking for is not on the first line, you will need to determine the location of each character that you are looking for, the last row of each line Modifying the substrings to delete When you find the end of a line, the height of shape offset has changed between iterations, when you can note the end of a line by note .

Comments