开发者

Uitextview scroll view position

开发者 https://www.devze.com 2023-04-12 03:38 出处:网络
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 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];
}
0

精彩评论

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

关注公众号