在UITextView中滚动文本

| 我有一个UITextView:当我隐藏键盘时,使用此代码返回文本的起点
-(BOOL)textViewShouldBeginEditing:(UITextView *)textView {
    ...
    NSRange range = NSMakeRange(0,1);
    [note scrollRangeToVisible:range];
    return YES; 
}
但是我写4行时如何滚动文本?因此不会覆盖键盘上的文字 谢谢大家     
已邀请:
        您可以将contentInset设置为键盘的高度。 收听ѭ1通知。实现这样的事情:
CGFloat keyboardHeight = ... // The userInfo variable contains keyboard info.
[textView setContentInsets:UIEdgeInsetsMake(0.0, 0.0, keyboardHeight, 0.0)];
这将自动为您滚动文本视图。     

要回复问题请先登录注册