开发者

Text Keyboard with Numbers Mode

开发者 https://www.devze.com 2023-03-25 17:43 出处:网络
I have an EditText which accepts numbers and characters as input. Most of t开发者_JAVA技巧he time the user enters numbers and I want to have the text keyboard but it should be in symbols or numbers mo

I have an EditText which accepts numbers and characters as input. Most of t开发者_JAVA技巧he time the user enters numbers and I want to have the text keyboard but it should be in symbols or numbers mode where you can enter the numbers directly. Is this possible?

On the Nexus S there are characters on the keyboard with input type set as "number" but I cannot add characters.

Thanks in advance


Not sure why it works but works at least on my Motorola RAZR

editText.setInputType(InputType.TYPE_CLASS_TEXT); editText.setRawInputType(InputType.TYPE_CLASS_NUMBER);

This show numeric keyboard but if you need you can switch to the text mode

0

精彩评论

暂无评论...
验证码 换一张
取 消