点击checkBox显示出密码的内容

           设置一个EditText填写密码   ed    设置一个checkBox来控制显示或是不显示密码的内容  cb

当点击CheckBox的时候  设置EdiTtext的内容为可见

CheckBox的点击事件

                if(cb.isChecked){

//设置EditText的内容为可见的

  et.setTransformationMethod(HideReturnsTransformationMethod.getInstance());

}

else{

//设置EditText的内容为隐藏不显示内容是什么

et.setTransformationMethod(PasswordTransformationMethod.getInstance());

}

猜你喜欢

转载自m-wen997721750.iteye.com/blog/1909811