没有完成按钮的 UIKeyboardTypeNumberPad
我们如何实现 UIKeyboardTypeNumberPad 以便它有一个“完成”按钮?默认情况下它没有。
How can we implement UIKeyboardTypeNumberPad so that it will have a 'done' button? By default it does not have one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果我没记错的话,那么您想询问如何为 UIKeyboardTypeNumberPad 的键盘添加自定义“完成”按钮。在这种情况下,这可能会有所帮助。在.h中声明一个 UIButton *doneButton 并将以下代码添加到.m文件中
我在我的应用程序中使用相同的代码,因此调整了按钮的框架,因此,每当您需要显示完成按钮时,您都可以调用 [self addButtonToKeyboard ]在键盘上。否则,UIKeyboardTypeNumberPad 没有“完成”按钮。
If I am not wrong then You want to ask as to how to add a custom "Done" button to keyboard for UIKeyboardTypeNumberPad . In that case this might be helpful. Declare a UIButton *doneButton in.h and add the following code to .m file
I am using the same in my application and the button's frame are thus adjusted, You can thus call [self addButtonToKeyboard ] whenever you need to show up the done button over the keyboard. UIKeyboardTypeNumberPad has no Done button otherwise.
iOS 5 问题已解决。谢谢一百万。
我在显示“完成”按钮时遇到问题。
替换:
在 iOS 5 中不显示完成按钮...
替换为:
工作得很好。你是一个明星。谢谢,尼古拉;-)
iOS 5 issue resolved. Thanks a million.
I had a problem with displaying the Done button.
Replaced:
which did not display the done button in iOS 5...
With:
Worked a treat. You're a star. Thanks, Nicola ;-)
如果有人遇到这样的问题:当您尝试在同一应用程序中加载其他类型的键盘时,“完成”按钮不断弹出,我知道很多应用程序都存在此问题。
不管怎样,我是这样解决这个问题的:
在您的 ViewController(您添加“完成”按钮的同一视图控制器)中添加此代码(按原样),它应该可以解决“完成”按钮不断重新出现的问题。
希望它对一些人有帮助。
}
If anybody had a problem that the DONE button keeps popping up when you try to load other types of keyboards in the same app, I know a lot of apps out there have this issue.
Anyway, here is how I solved this:
In your ViewController ( the same viewcontroller that you added DONE button ) add this code ( as is ) and it should solve your problems with DONE button keep reappearing.
Hope it helps to some folks.
}