ANDROID - 数字键盘 [英] ANDROID - Numeric keyboard
本文介绍了ANDROID - 数字键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下午好。
我有可能包含数字和字母一个EditText。通过部署键盘,有没有什么办法可以以数字形式部署呢?
I have an EditText that may contain numbers and letters. By deploying the keyboard, is there any way to deploy it in numerical form?.
如果我把这个作为的EditText数字我这样做,但这不是我的情况。
If I put the EditText as numeric I do, but that's not my case.
非常感谢你。
推荐答案
试试这个:
EditText myEditText = (EditText)findViewById(R.id.myEditText);
myEditText.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
然后将其设置回字母,当你用数字做了。
Then set it back to alphanumeric when you are done with numeric..
这篇关于ANDROID - 数字键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文