I have a UITextView: When I do hide the keyboard, I return to the starting point of the text with this code
-(BOOL)textViewShouldBeginEditing:(UITextView *)textView {
...
NSRange range = NSMakeRange(0,1);
[note scrollRangeToVisible:range];
return YES;
}
but how can I do to scroll the text when I write, for example, 4 lines? so does not cover the text from the keyboard
thanks to all
You can set the contentInset to the height of the keyboard.
Listen for the
UIKeyboardWillShowNotificationnotification. Implement something like this:That will scroll the text view automatically for you.