Forum Xamarin Xamarin.Android

How to Change Password Visibility

AmolKAmolK INMember ✭✭

I want to change EditText views input type Dynamically.
If the Checkbox is selected then It should show Password and When checkbox is not checked then it should hide password by Dots | Stars....

Best Answer


  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Your best bet is to change the EditText's InputType dynamically based on the CheckBox.Checked boolean value.

    Thus you might have the EditText default InputType to TYPE_TEXT_VARIATION_PASSWORD

    When your CheckBox.Checked is true, you would set the EditText InputType to TYPE_TEXT_VARIATION_VISIBLE_PASSWORD

    Or a variation along those lines.

  • AmolKAmolK INMember ✭✭
    Accepted Answer

    Thanks @JonDouglas

Sign In or Register to comment.