操作键盘
因此,我想更改应用程序内键盘的布局,以便它将包含一个“下一个”按钮(它将在文本字段之间切换,类似于普通键盘上的 Tab 键)和“完成”按钮(以关闭我想改变的另一件事是,当您选择某些文本字段(仅接受数字)时,使键盘显示数字键盘而不是通常的布局。但是,我不知道如何做这样的事情。任何帮助将不胜感激。
So, I'd like to change the layout of the keyboard inside my app, such that it will include a next button(which would switch between text fields, similar to the tab key on a normal keyboard) and done button (to dismiss the keyboard altogether).Another thing I'd like to change would be to make the keyboard bring up the numpad instead of the usual layout when you choose certain text fields (which are meant to accept numbers only). However, I don't have a clue how to do such a thing. Any assistance would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,除了在 Apple 的不同系统键盘之间进行选择之外,如果您想要“下一步”和“完成”,则必须自己编写整个内容...
因此您可以在“完成”按钮和“下一步”按钮之间进行选择。这些只是将 Return 键重命名为 Done 或 Next;因此你不能同时进行下一步和完成。
来获取“下一步”按钮
您可以通过设置“当您获取返回键消息时,您可以在用户的下一个文本字段上调用 setFirstResponder” 。大概在最后一个字段中,您可以通过设置“完成”按钮
对于数字键盘,您可以设置您的
键盘类型的选择是:
请注意,这些都是为您本地化的。
Sorry, other than choosing between Apple's different system keyboards, if you want both Next and Done, you'd have to write the whole thing yourself...
So you have a choice between the Done button and the Next button. These just rename the Return key to Done or Next; hence you can't have both Next and Done at the same time.
You get the Next button by setting
When you get the return key msg, you can then call setFirstResponder on the next text field for your user. Presumably on the last field, you get the Done button by setting
For the number keypad you can set your
Your choices for keyboard types are:
Note that these are all localized for you.