带有“开始”按钮而不是返回按钮的 iOS 键盘

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4489879/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 18:21:10  来源:igfitidea点击:

iOS keyboard with "Go" button instead of return

iphoneobjective-ciosipadcocoa-touch

提问by Altealice

Is there a way to use the keyboard with "Go" key instead of the "Return" key like when you are accessing login fields in Safari? I'm guessing this should be something trivial but my searches aren't turning up anything. :(

有没有办法像在 Safari 中访问登录字段一样使用带有“Go”键而不是“Return”键的键盘?我猜这应该是微不足道的,但我的搜索没有发现任何东西。:(

Thanks in advance.

提前致谢。

回答by BoltClock

For a UITextFieldor editable UITextView:

对于 aUITextField或可编辑的UITextView

[myTextField setReturnKeyType:UIReturnKeyGo];

You can also configure this in Interface Builder, under Text Input Traitsfor your text field/view:

您还可以在 Interface Builder 中的Text Input Traits 下为您的文本字段/视图进行配置:

回答by Daniele D.

In Xamarin.iOS or Monotouch is:

在 Xamarin.iOS 或 Monotouch 中是:

myTextField.ReturnKeyType = UIReturnKeyType.Go;

Possible values are:

可能的值为:

   Default
   Go
   Google
   Join
   Next
   Route
   Search
   Send
   Yahoo
   Done
   EmergencyCall
   Continue

回答by AmyNguyen

You can use this simple way: [textField setReturnKeyType:UIReturnKeyGo];instead of "Add" button.

您可以使用这种简单的方法:[textField setReturnKeyType:UIReturnKeyGo];而不是“添加”按钮。

Other, you create a programmatically keyboard with buttons which you want.

其他,您创建一个带有您想要的按钮的编程键盘。