TransformationMethod transformationMethod = mEtPwd.getTransformationMethod();
if (transformationMethod instanceof PasswordTransformationMethod) {
mEtPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
mImgLook.setImageResource(R.drawable.look_on);
} else {
mEtPwd.setTransformationMethod(PasswordTransformationMethod.getInstance());
mImgLook.setImageResource(R.drawable.look_off);
}
mEtPwd.setSelection(mEtPwd.getText().toString().length());
EditText隐藏显示密码
最新推荐文章于 2023-01-09 11:00:00 发布