Reputation: 359
I want to send the keyboard down after writing in textField.
How can I do this?
Any help would be appreciated.
Upvotes: 0
Views: 1773
Reputation: 11
STEP-1:
You need to set the delegate of the textField to File's Owner (using interface builder)
or
textField.delegate = self;
from the viewController programmatically first
STEP-2:
And you implement the method:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
Hope this helps.
Upvotes: 1
Reputation: 6475
- (IBAction)textFieldDoneEditing:(id)sender{
[sender resignFirstResponder];
}
connect this to didEndOnExit action of your textfield
Upvotes: 0
Reputation: 58448
Implement the - (BOOL)textFieldShouldReturn:(UITextField *)textField;
delegate method and tell the text field to resign it's first responder status.
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
Upvotes: 3