Android password edit text showing text

浪尽此生 提交于 2019-12-08 16:22:48

问题


I have used one Edittext with attribute android:inputType="textPassword".

But when I type some text in it, text is getting visible character by character before changing to solid bullets.

How can I make the text invisible as the user inputs the text.

Please help me.


回答1:


Try to add EditText attribute

android:inputType="text"

And also add programmatically

edt_password.setTransformationMethod(new PasswordTransformationMethod());




回答2:


i have used the below in my application and text does not appear. Worked for me!

<EditText
        android:id="@+id/OldpwdET"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="30dp"
        android:ems="10"
        android:hint="@string/change_password_oldpwdET"
        android:minHeight="40dp"
        android:paddingLeft="10dp" 
        android:inputType="textPassword">



回答3:


Try this..

in edittext layout

  android:inputType="text"

and in your code.,put this.

  mEditText.setTransformationMethod(new AsteriskPasswordTransformationMethod());


来源:https://stackoverflow.com/questions/21900095/android-password-edit-text-showing-text

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