开发者

resignFirstResponder fails to dismiss my custom keyboard on iPad. Why?

I've created a custom keyboard and used the inputView property to associate it with a UI开发者_如何学运维TextField. When the "dismiss" button on my custom keyboard is pressed, I call resignFirstReponder on my text field.

Before you dismiss this as another IB outlet issue, it's not. The text field pointer is valid, and in fact after calling resignFirstResponder, the caret disappears, which proves that resignFirstResponder is in fact working. It's just that my custom keyboard isn't hiding itself. Any idea why?

Do I need to do anything special on the custom keyboard to make it hide itself?


Try this:

[textField endEditing:YES];

It forces the textField to hide it's keyboard, but I'm not 100% sure it works for custom keyboards too. Give it a try :)!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜