只在 Android 软键盘上显示数字按钮? [英] Only show number buttons on Soft Keyboard in Android?
本文介绍了只在 Android 软键盘上显示数字按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Android 的软键盘上,您可以使用 android:inputType="numberDecimal"
将软键盘设置为显示数字而不是 a-z 键盘.但是,如果我只想显示顶部编号行 1 2 3 4 5 6 7 8 9 0
而不是以 @ # $ % 开头的以下行,我该怎么办...
?
On the soft keyboard in Android you can set the soft keyboard to show the numbers instead of a-z keyboard using android:inputType="numberDecimal"
. However, what do I do if I only want to show the top number row 1 2 3 4 5 6 7 8 9 0
and not the following rows starting with @ # $ % ...
?
感谢收听!
推荐答案
你只能在你的代码中添加这一行:
You must only add this line on your code:
input.setRawInputType(Configuration.KEYBOARD_12KEY);
这将仅显示数字键盘.
这篇关于只在 Android 软键盘上显示数字按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文