Make EditText accept non-English numbers

时间秒杀一切 提交于 2020-01-04 05:22:27

问题


I made a very simple app that involves only numbers and there is no need to make different locale folders or anything.

When I test the app, the EditText will take numbers when the keyboard language is English, but when I change the keyboard to other languages it does not work! pressing a number will not show up in the EditText.

Is there a way to make the EditText take universal numbers regardless of the language?


回答1:


I think it will work

 <EditText 
    android:inputType="numberSigned|numberDecimal|numberPassword|number"/>

and according your need put separator between choice i.e | and press ctrl+space you will get more option .




回答2:


you'd add android:inputType="number"



来源:https://stackoverflow.com/questions/16578009/make-edittext-accept-non-english-numbers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!