开发者

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];
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜