private ImageView ivNewpw; private EditText etPhone; ivNewpw = (ImageView) findViewById(R.id.iv_newpw); etPhone = (EditText) findViewById(R.id.et_phone); ivNewpw.setonClickListener(new View.onClickListener() { @Override public void onClick(View v) { TransformationMethod method = etPhone.getTransformationMethod(); if (method == HideReturnsTransformationMethod.getInstance()) { etPhone.setTransformationMethod(PasswordTransformationMethod.getInstance()); ivNewpw.setBackgroundResource(R.mipmap.uneye); } else { etPhone.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); ivNewpw.setBackgroundResource(R.mipmap.eye); } } });
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)