tags:

views:

88

answers:

1

Hi!

I use a UITextView in my application. The text editing is ok. I set the return button to Done. When I finish the editing, I like to hide the keyboard with the done button. My Question: How can I set the done button?

Thanks, Balu.

A: 

Set your controller as the textField's Delegate, implement UITextField Delegate method textFieldShouldReturn in your controller and resign first responder before returning TRUE/YES:

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
lukya