Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的项目中有很多输入字段,它们都接受数字值,然后是字母值(如 246736adsf),所以我想首先显示数字键盘(在具有数字和字母值的键盘中)和字母选择。我尝试了很多,但所有问题都只打开数字而不是两者的组合。所以请帮助我摆脱这个问题。感谢您。
将输入类型设置为数字以像这样编辑文本
android:inputType="number"
更新
EditText text = (EditText)findViewById(R.id.editText); text.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_CLASS_TEXT);