Android(安卓)CheckBox使密码可见/隐藏
16lz
2021-12-04
CheckBox cbx_pwd_visi;//CheckBoxEditText edt_pwd;//Password input//CheckBox事件监听cbx_pwd_visi.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { edt_pwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());//选中CheckBox,显示密码 } else { edt_pwd.setTransformationMethod(PasswordTransformationMethod.getInstance());//隐藏密码 } }});
更多相关文章
- Android应用前后台监听最简单的方法
- android 隐藏输入法
- EditText去掉边框和隐藏光标
- Android(安卓)CoordinatorLayout的使用——实现Toolbar的隐藏和
- android 滑动欢迎界面
- android 入门 Gallery
- 38 Android(安卓)actionbar 简单使用
- android 监听软键盘 回车键
- Android(安卓)BottomNavigationView的使用