how to disable uikeyboard of textview ,if the editing mode enabled

1.7k views Asked by At

How to hide/disable keyboard ,if the textview editing is enabled.

I only want to that user can only be able to select the text and can't be allowed for entering text.

Because selected text will be converted in to image for move animation.

User will not be allowed for entering any text in textview so that's why keyboard should be hidden or disable ,he will be allowed only for text selection.

5

There are 5 answers

1
beryllium On BEST ANSWER

uitextview.editable = NO; or set checkmark in IB. It will allow to select text with options - Copy and Select All without keyboard appearing. Tap on the word and hold to select text.

1
freelancer On

try this

yourtextview.UserinterationEnable=No;

1
jhavatar On

This will make the keyboard disappear:

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

This what you want to do?

2
freelancer On

ok just uncheck the behavior of you UItextview in .xib file.

1
Phillip Mills On

Something to try it the 'editable' setting doesn't work out is to create a UIView that's hidden and out of the way somewhere and assign it as the inputView for the text view. If that property is non-nil, the view it contains will be shown instead of the keyboard.

Such as:

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