views:

1134

answers:

1

Hi, 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

+1  A: 

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 {  
}
bcwood
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
Nope, this is pretty much what we're stuck with. There's a lot about the iPhone SDK that isn't exactly intuitive.
bcwood
A related question is: how do I get the "Done" key to appear on my keyboard? I don't appear to have one.
MusiGenesis
@musigenesis: Its a property of the UITextField, "Return key".
grilix