switch (v.getId()) { case R.id.eye1: if (hide) { hide = false; eye1.setImageResource(R.drawable.baseline_remove_red_eye_24); //可见样貌 HideReturnsTransformationMethod method = HideReturnsTransformationMethod.getInstance(); //可见 mima.setTransformationMethod(method); } else { eye1.setImageResource(R.drawable.baseline_remove_red_eye_24_close); //不可见样貌 hide = true; TransformationMethod method = PasswordTransformationMethod.getInstance(); //隐藏 mima.setTransformationMethod(method); }标签:24,eye1,hide,baseline,getInstance,24.1,笔记,method From: https://www.cnblogs.com/laobing6214/p/17986074