Android中实现密码的隐藏和显示的示例

  

在Android开发中,需要密码的隐藏和显示,下面就和大家分享一下使用方法:
  

  

xml代码:

        LinearLayout & lt;   android: layout_width=" match_parent "   android: layout_height=" 50 dp”   android:背景=" @color/白”   面向android:="水平"比;      & lt; TextView   android: layout_width=" wrap_content "   android: layout_height=" match_parent "   android:文本="新密码”   android:输入textColor=" @color/黑”   android: textSize=" 18 dp "   android:重力=" center_vertical "   android: layout_marginLeft=?5 dp/比;      EditText & lt;   android: id=癅 + id/newpassword”   android: layout_width=" 0 dp”   android: layout_weight=" 1 "   android: layout_height=" match_parent "   android: layout_gravity=" center_vertical "   android: layout_marginLeft=" 10 dp”   android: inputType=" textPassword "   android:提示="请设置登录密码”   android:背景=" @null "/比;      & lt;复选框   android: id=癅 + id/复选框”   android: layout_width=" wrap_content "   android: layout_height=" match_parent "   android: layout_marginRight=" 15 dp "   android: textSize=" 16 dp "   android:文本="显示”/比;      & lt;/LinearLayout>      之前      

<>强隐藏图标代码

        android:按钮=" @null "      

JAVA代码:

     /* *   *由fby alt=" Android中实现密码的隐藏和显示的示例“>
  

  

 Android中实现密码的隐藏和显示的示例

  

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
  

Android中实现密码的隐藏和显示的示例