改变输入法右下角完成按钮的文字

UE提出想改输入键盘输入法右下角的enter button的文字,但是经过一番探索发现自定义几乎是不可能的。


改变输入法右下角完成按钮的文字_第1张图片
输入键盘

我们只能通过设定TextView 的 android:imeOptions ,在几个行为模式间切换

  • actionGo(开始)
  • actionSearch(搜索)
  • actionSend(发送)
  • actionNext(下一个)
  • actionDone(完成)
  • actionPrevious(前一个)

不同的输入法会用不同的方式实现以上行为,比如,有的actionSearch会是“搜索”文字,有的会是一个放大镜图标,有的actionDone会是“完成”文字,有的会是一个回车图标。

android:imeActionLabel 这个不是用来给我们自定义右下角这个enter button的文字用的,用它设置的文字的用途是:

The full label is only displayed when the IME has a large amount of space for it (such as when the standard keyboard is in fullscreen mode).

Google+ Android论坛的这篇讨论中解释得很好

You can't set it to anything you want, you can only specify one of the standard actions. This is because the UI for the keyboard is highly constrained and it is not practical for it to try to accept arbitrary input there.

综上,我们只需要定义这个enter button的行为,而不是它显示的文字。

你可能感兴趣的:(改变输入法右下角完成按钮的文字)