4

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 AFTER 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!!

Tiago_Brasil
  • 121
  • 2
  • 9
  • Also two good answers here: http://stackoverflow.com/questions/8170278/how-to-disable-keyboard-on-a-uitextview – sdjuan Aug 19 '12 at 21:29

1 Answers1

6

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

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{
    return NO;
}
Vladimir
  • 170,431
  • 36
  • 387
  • 313