UITableViewCell with a UITextView inside - scrolls even when disabled!
I am creating a table view cell with a text view inside and my problem is that I do not want the text view to scroll when it becomes first responder.
I have set scrollEnabled
to NO
and that avoids scrolling most of the time. But when the text view is completely filled up with text (I do not allow the user to enter more text than the text view can contai开发者_运维技巧n without scrolling) it scrolls up a bit when it becomes first responder.
How can that be avoided? :/
Thanks a lot,
StineYou can determine where the text view will scroll to when it becomes first responder by setting the selected range.
Setting it like this:
[textView setSelectedRange:NSMakeRange(0, 0)];
will keep the text view scrolled to the top.
精彩评论