iPad keyboard won't Dismiss
I have a very strange problem. I have a table view with text fields (UITextField
) in way that the table view is used as a text editor (as UITextView
doesn't satisfy my demands). Everything works well, except for one: the "hide keyboard" button — the button at the right-bottom corner of the virtual keyboard — doesn't work. It doesn't dismiss the keyboard. It doesn't send any method (delegate or target-action) either.
I added breakpoints everywhere. No methods are getting invoked when pushing the button. All other ones work. I do receive calls when editing begins or ends or when the return or clear button is pushed. It's not like my code crashed somewhere.
开发者_如何学JAVAThe thing is that this problem only occurs in my project. It doesn't occur elsewhere. And as I don't have a membership yet, I can only test in the Simulator.
Any suggestions? Thank you!
Are you resigning first responder anywhere? Try with:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
I found this via google, figured some more info might help:
If the keyboard does not disappear when you click Done, you might not have connected the text field’s delegate or connected the view controller’s textField outlet to the text field. Be sure to check the text field’s connections: Control-click the text field to reveal the translucent connections panel. You should see filled-in circles next to the delegate outlet and the textField referencing outlet.
精彩评论