消失的 iPhone 数字键盘
我如何在iPhone中消失数字键盘,因为它没有返回键,这意味着它不会响应
- (BOOL)textFieldShouldReturn:(UITextField *)textField
How I can disappear numeric keyboard in iPhone because there is no return key in it, which implies it is not going to respond to
- (BOOL)textFieldShouldReturn:(UITextField *)textField
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用 resignFirstResponder in TouchesBegan,如下所示:
如果您不确定焦点当前位于何处,您可能需要在多个文本字段上调用此方法;我还没有测试过这种情况。
此外,在 Interface Builder 中,您需要启用视图的“User Interaction Enabled”复选框,或以编程方式使用:
Use resignFirstResponder in touchesBegan, like so:
You may need to call this on multiple text fields if you're not sure where the focus is currently located; I haven't tested that case.
Additionally, in Interface Builder, you'll need to enable the "User Interaction Enabled" checkbox for the view, or programatically use:
这是答案..
Here's the answer..
试试这个:
Try this:
为什么不使用“数字和标点符号”键盘而不是“数字”?它将节省您的时间
Why not to use "Numbers and Punctuation" keyboard instead of "Numeric"? It will save your time
干得好。用它扩展你的 UIViewController 类。但我们怎么知道它是完成按钮呢? 将“完成”按钮添加到 iPhone 上的数字小键盘
Here you go. Extend your UIViewController Class with this. But how do we know it is the done button? Adding Done Button to Only Number Pad Keyboard on iPhone