为什么点击 UITextField 不会打开键盘?
我对 Objective-C 和 Cocoa Touch 很陌生。我一直在遵循一本书中的教程。目前,我有一个 UITextField ,它应该在用户点击时打开键盘以输入输入。
但是,当我运行该应用程序时,点击文本字段时没有任何反应。我已经检查了它的所有属性,并确保它已启用并且用户交互已启用。
我真的缺少什么明显的东西吗?我把教程看了两三遍,还是不明白哪里出了问题。
I'm very new to Objective-C and Cocoa Touch. I have been following tutorials from a book. Currently I have a UITextField
that is supposed to open the keyboard on a tap from the user to enter input.
However, when I run the app, nothing happens when I tap on the text field. I've checked all its attributes and made sure that it's enabled and user interaction is enabled.
Is there something really obvious I'm missing? I've read the tutorial two to three times, and I can't figure out what's wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否链接了界面生成器中的所有内容(如果您通过 XIB 创建了文本字段)
have you linked everything in interface builder (if you created the textfield by XIB)
将该文本字段设置为第一响应者。请参阅如何设置第一响应者?。
Set that textfield as firstresponder. See How do I set the firstresponder?.