Reputation: 16793
There is a 'Done' button on the input pad on iphone, but there is no action to it by default. Can I add an action to it? For example, hide the input pad when 'Done' is pressed?
Upvotes: 1
Views: 1182
Reputation: 58804
In your keyboard delegate you need to give up the focus. E.g
- (BOOL)textFieldShouldReturn:(UITextField *)aTextField
{
[aTextField resignFirstResponder];
return YES;
}
This works for both the done and return keys.
Upvotes: 6