How to disable uikeyboard textview if editing mode is enabled

How to hide / disable the keyboard if text field editing is enabled.

I just want this user to be able to only select text and not allow text input.

Because the selected text will be converted to an image to move the animation.

The user is not allowed to enter text in text form, so the keyboard must be hidden or disabled, it will be allowed only to select text.

+3
source share
5 answers

uitextview.editable = NO;or check the box in IB. This will allow you to select text with options - Copy and Select All without the keyboard appearing. Press and hold a word to select text.

+4
source

ok UItextview .xib.

+3

Something that you can try, the “editable” parameter does not work, so create a UIView that is hidden and deleted somewhere, and assign it as inputView for the text view. If this property is not nil, the view it displays will be displayed instead of the keyboard.

For instance:

self.textView.inputView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)] autorelease];
+1
source

try it

yourtextview.UserinterationEnable = No;

0
source

This will cause the keyboard to disappear:

[[[UIApplication sharedApplication] keyWindow] endEditing:YES];

Is that what you want to do?

0
source

All Articles