开发者

How to prevent the keyboard from showing (not dismissing) on a TextView?

开发者 https://www.devze.com 2023-03-26 08:02 出处:网络
I would like to know how to DISABLE (not how to dismiss) the iOS keyboard in a TextView. I don`t even want the keyboard to show up when the user touches the TextView.

I would like to know how to DISABLE (not how to dismiss) the iOS keyboard in a TextView. I don`t even want the keyboard to show up when the user touches the TextView.

All of the examples I found were to make the keyboard disappear AF开发者_Python百科TER it appears.

The closest thing I got was to set textView.userInteractionEnabled = NO; but that gets rid of the scrolling as well (I want to keep the scrolling).

Thank you in advance!!


Try to implement the following method in text view's delegate:

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{
    return NO;
}
0

精彩评论

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