Uitextview scroll view position
I am trying to implement UITextView
in my iphone app. UITextView
's content increases dyamically.
At same time I want to move scroll pos开发者_如何学编程ition also.
I am trying to scrollToVisibleRect
method, but not getting any success.
Thanks
If I understand your question properly then you want to scroll your text view at the bottom of text. To do so try this :
- (void) goToBottom
{
NSUInteger length = self.myTextView.text.length;
self.myTextView.selectedRange = NSMakeRange(length, 0);
[myTextView setContentOffset:CGPointMake(length, 0) animated:YES];
}
精彩评论