开发者

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 scrollEnabledto 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,

Stine


You 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜