Reputation: 89
I have a strange problem with the iOS Keyboard.
In my app, I am using UITextFields inside some UITableViewCells. I want to dismiss the keyboard if the current textfield loses its focus.
This is what I've done so far:
Set up the <UITextFieldDelegate>
and add [textField resignFirstResponder] to textFieldDidEndEditing:
-> textFieldDidEndEditing
gets called, but the keyboard stays.
Added all TextFields to an array, looped through all objects and call resignFirstResponder
-> No effect
Called [self.tblView endEditing:YES
] inside textFieldDidEndEditing.
But dismissing the keyboard by using the Done-Button works perfectly (using textFieldShouldReturn
)
What am I doing wrong?
Edit: I've made a video of my problem: http://www.youtube.com/watch?v=Zuz5rCv2GCo
Upvotes: 0
Views: 671
Reputation: 69
try implementing following:
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
[textField becomeFirstResponder];
}
-(void)textFieldDidEndEditing:(UITextField *)textField
{
[self resignFirstResponder];
}
Upvotes: 0