Show the password with EditText

前端 未结 12 913
旧时难觅i
旧时难觅i 2021-01-30 22:04

I use an EditText to enter password. And a CheckBox to show password or not. Below function is the part:

public void ShowPassword() {
    if (cb.isChecked()) {
          


        
12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 22:38

    use app:passwordToggleEnabled = true; available from Android support library version 24.2.0.

      
    
        
    
    
    

提交回复
热议问题