how to change edittext password filed characters to star instead of dots android?

我只是一个虾纸丫 提交于 2019-12-08 07:23:01

问题


I created one login application with username and password fields.here my problem is when i insert the password text in edittext filed bydefault its shows in dots. I want to show it in stars symbol.Is it possible in android? If possible please help me.

regards, Madhu.


回答1:


You use setTransformationMethod() and something like the PasswordTransformationMethod

i.e. you make your own PasswordTransformationMethod, where instead of the DOT :

   private static char DOT = '\u2022';

You use whatever you fancy. Asterisk is \u002A



来源:https://stackoverflow.com/questions/8195494/how-to-change-edittext-password-filed-characters-to-star-instead-of-dots-android

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