I am using a UITextView and I am confused about making the keyboard to disappear. Do I need to use some kind of a notification to make it disappear. Thanks
Asked
Active
Viewed 3,836 times
1 Answers
1
It's not very intuitive, but all you have to do is implement the doneButtonOnKeyboardPressed
event in your view controller. You don't actually have to do anything inside of the event handler, just handling it will cause the keyboard to disappear after the user taps "Done".
An empty handler will look something like this:
- (IBAction) doneButtonOnKeyboardPressed:(id)sender {
}

Brandon Wood
- 5,347
- 4
- 38
- 31
-
Hey Thanks for the reply. It worked. You mentioned that it is not very intuitive. Can you please tell whether there is any other control I can use for multiple line input in iPhone. Thanks – felix Aug 26 '09 at 21:18
-
Nope, this is pretty much what we're stuck with. There's a lot about the iPhone SDK that isn't exactly intuitive. – Brandon Wood Aug 27 '09 at 14:42
-
A related question is: how do I get the "Done" key to appear on my keyboard? I don't appear to have one. – MusiGenesis Oct 26 '10 at 15:18
-
@musigenesis: Its a property of the UITextField, "Return key". – grilix Oct 27 '10 at 12:01
-
If I *just* add in that code the event doesn't get triggered. Guess I'm missing some connection between the GUI element I'm seeing, and the code I've written. To do the same thing with UITextField I can go look at the 'connections' panel and see the events available, including 'Did End On Exit'. I can then drag a connection onto the handling code. But UITextView doesn't show any 'Send Events'. – Harry Wood Dec 15 '11 at 23:01