在Android数字软键盘 [英] Numeric Soft Keyboard on Android

查看:317
本文介绍了在Android数字软键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

感谢和问候。

解决方案

  editTextField.setRawInputType(Configuration.KEYBOARD_QWERTY);
 

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

  getInput.setRawInputType(Configuration.KEYBOARD_12KEY);
 

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

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

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.

这篇关于在Android数字软键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆