Android: How to set password property in an edit text?

前端 未结 9 2040
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 05:59

I need to create a login form with \'username\' \'password\' fields and two buttons \'login\' and \'cancel\' in my android application.

I am using an alert dialog w

9条回答
  •  自闭症患者
    2020-12-14 06:29

    My search for a similar solution for Visual Studio 2015/Xamarin lead me to this thread. While setting the EditText.InputType to Android.Text.InputTypes.TextVariationVisiblePassword properly hid the password during user entry, it did not 'hide' the password if it was visible before the EditText Layout was rendered (before the user submitted their password entry). In order to hide a visible password after the user submits their password and the EditText Layout is rendered, I used EditText.TransformationMethod = PasswordTransformationMethod.Instance as suggested by LuxuryMode.

提交回复
热议问题