开发者

iPad keyboard won't Dismiss

开发者 https://www.devze.com 2023-03-14 14:47 出处:网络
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

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.

开发者_如何学JAVA

The 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消