在Android数字软键盘键盘、数字、Android

2023-09-12 07:31:17 作者:其实﹏莪还好

我发展,我们正在使用的WebView显示Web页面的Web服务器提供服务的android应用。一切工作正常,除了这个问题,当我使用软键盘,并切换到数字键条目,然后从第一个字段移动到下一个字段,键盘布局将自动变更为字母。

有没有用,我可以拉起来的虚拟键盘在数字模式只有当我需要输入任何数字仅?

感谢和问候。

解决方案

  editTextField.setRawInputType(Configuration.KEYBOARD_QWERTY);
 

这显示了第一个数字版的普通键盘,还可以让你在它们之间进行切换。

  getInput.setRawInputType(Configuration.KEYBOARD_12KEY);
 

这只能显示数字,无可选择地输入文本值。

我遇到了类似的情况。我想数值而已,但我有一个暗示,这是文本。该inputType设置为数字不会允许要显示的提示。这工作得很好解决它。

android 数字键盘 如何在Android的Google键盘中添加专用数字行

I am developing an android application where we are using WebView to display Web page being served from Web Server. Everything is working fine except with the problem that when i am using the soft keyboard and switched to numeric key entry and move from first field to next field, the keyboard layout automatically changed to alphanumeric.

Is there any way using which i can pull up virtual keyboard in numeric mode only when i need to enter numbers only?

Thanks and Regards.

解决方案

editTextField.setRawInputType(Configuration.KEYBOARD_QWERTY);

This shows the normal key pad with the numeric version first, yet allows you to switch between them.

getInput.setRawInputType(Configuration.KEYBOARD_12KEY);

This shows numeric only, with no option to enter text values.

I ran into a similar situation. I wanted numeric values only, but I have a "hint" that was text. Setting the inputType to number would not allow the hint to be displayed. This works around it fine.