iPad 键盘无法关闭
我有一个非常奇怪的问题。我有一个带有文本字段(UITextField
)的表格视图,该表格视图用作文本编辑器(因为UITextView
不能满足我的要求)。一切正常,除了一个:“隐藏键盘”按钮(虚拟键盘右下角的按钮)不起作用。它不会关闭键盘。它也不发送任何方法(委托或目标操作)。
我到处都添加了断点。按下按钮时不会调用任何方法。所有其他的都有效。当编辑开始或结束或按下返回或清除按钮时,我确实会接到电话。这不像是我的代码在某个地方崩溃了。
问题是这个问题只出现在我的项目中。它不会发生在其他地方。由于我还没有会员资格,所以我只能在模拟器中进行测试。
有什么建议吗?谢谢你!
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.
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否在任何地方辞去急救人员职务?
尝试使用:
Are you resigning first responder anywhere?
Try with:
我通过谷歌发现了这一点,认为更多信息可能会有所帮助:
如果单击“完成”时键盘没有消失,您可能没有连接文本字段的委托或将视图控制器的 textField 出口连接到文本字段。请务必检查文本字段的连接:按住 Control 键单击文本字段以显示半透明的连接面板。您应该在委托出口和引用出口的文本字段旁边看到实心圆圈。
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.