ios 更改“返回”键盘按钮的文本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/976950/
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 16:00:52  来源:igfitidea点击:

Change text of "Return" keyboard button

ioscocoa-touchuikeyboard

提问by Ilya Suzdalnitski

How can I change the standard text of the "Return" button to something else?

如何将“返回”按钮的标准文本更改为其他内容?

I want it to be "Add".

我希望它是“添加”。

回答by macbirdie

Unfortunately, you can change "Return" into only one of these predefined labels with the returnKeyTypeproperty:

不幸的是,您可以使用以下returnKeyType属性将“返回”更改为这些预定义标签之一:

  • Return (default)
  • Go
  • Google
  • Join
  • Next
  • Route
  • Search
  • Send
  • Yahoo
  • Done
  • Emergency Call
  • Continue (as of iOS 9)
  • 返回(默认)
  • 谷歌
  • 加入
  • 下一个
  • 路线
  • 搜索
  • 发送
  • 雅虎
  • 完毕
  • 紧急呼叫
  • 继续(从 iOS 9 开始)

So maybe you should choose "Next" if a data entry kind of activity is what you're after.

因此,如果您所追求的是数据输入类型的活动,也许您应该选择“下一步”。

More information here.

更多信息在这里

回答by AmyNguyen

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

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

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

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

回答by cmario

iOS 9 now supports Send button. This is the following swift code

iOS 9 现在支持发送按钮。这是以下快速代码

self.liveChatMessage.returnKeyType = .Send

Objective C:

目标 C:

[self.liveChatMessage setReturnKeyType: UIReturnKeyTypeSend];