我不能拔下键盘上的回车键吗?或至少将其文本更改为“设置”? [英] Can I not remove the return key on the keyboard? Or at least change its text to "Set"?

查看:64
本文介绍了我不能拔下键盘上的回车键吗?或至少将其文本更改为“设置”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的iPhone应用程序创建一个注册页面,并且在使输入视图适用于各种字段的方式保持一致时遇到一些问题。这些字段在表格视图中被列为单元格,并且应该通过从底部向上滑动适当的输入视图而直接在表格中进行编辑。

I am creating a sign up page for my iphone app and am having some problems making the way the input views work for the different kinds of fields consistent. The fields are listed as cells in a table view and the editing is supposed to take place directly in the table by having appropriate input views sliding up from the bottom.

让我仅关注此处的两个字段,即 username 字段和 birthday 字段:对于用户名字段,当用户使用时,具有ASCII键盘的滑盖是有意义的按下字段,而日期选择器似乎在生日字段中更有用。

Let me focus on only two of the fields here, namely the username field and the birthday field: for the username field it makes sense to have an ASCII capable keyboard sliding up when the user presses the field whereas a date picker seems more useful in the birthday field case.

对于键盘和日期选择器,取消按钮可以位于输入视图上方的工具栏中。但是设置按钮呢?如果我也将其放在工具栏中,则需要键盘上的回车键才能消失!

For both the keyboard and the date picker the cancel button could be located in a tool bar just above the input view. But what about the set button? If I put that in the toolbar as well I need the return key in the keyboard to go away! But that is not possible is it?

如果无法删除返回键,那么我可能只需要在生日时使用工具栏中的设置按钮,然后在用户名情况下使用返回键作为设置按钮-但是我至少可以将返回键上的文本更改为设置吗?

If the return key cannot be removed then I might have to live with the set button in the toolbar only in the birthday case and then use the return key as the set button in the username case - but can I then at least change the text on the return key to "Set"?

推荐答案

否,不可能*隐藏返回键。

No it's not possible* to hide the "Return" key.

也不能将字符串设置为 Set,但可以使用 .returnKeyType 属性将其更改为有限的字符串集

It is not possible to set the string to "Set" either, but could use the .returnKeyType property to change it to a limited set of strings.

theTextField.returnKeyType = UIReturnKeyDone;

(*可以将不透明的UIView直接放在上面,但这是一个非常不好的做法并且通常会在用户选择其他输入法时中断)

这篇关于我不能拔下键盘上的回车键吗?或至少将其文本更改为“设置”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆