How to block special characters in androids editText? no ANDROID:DIGITS

六眼飞鱼酱① 提交于 2019-12-12 19:12:38

问题


How to block special characters in androids editText? by not using android:digits!!

is there any other way around, even programmatically?


回答1:


EditText has an onTextChanged listener, you can follow the characters the user is inputting and if the character is illegal you just delete it. Not the most elegant way, but hope it makes it. Good luck!



来源:https://stackoverflow.com/questions/5906744/how-to-block-special-characters-in-androids-edittext-no-androiddigits

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