标签:
首先,有一个EditText和CheckedBox,在xml里面设置EditText的android:inputType="textPassword",为CheckedBox添加事件监听,
@Override
public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {
// TODO Auto-generated method stub
if (isChecked) {
mPswEdt.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
} else {
mPswEdt.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
}
}
标签:
原文地址:http://www.cnblogs.com/bbglz/p/4766799.html