Android 에서 EditText 암 호 를 실행 하여 숨겨 진 방법 을 표시 합 니 다.

Google 에서 support:design:23+를 발표 한 후에 우 리 는 TextInputLayout 라 는 것 을 발 견 했 습 니 다.먼저 효과 도 를 보 세 요.
这里写图片描述

<android.support.design.widget.TextInputLayout
  android:id="@+id/pwdLayout"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  app:passwordToggleEnabled="true"
  >
  <EditText
  android:id="@+id/pwdEdt"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:hint="@string/edt_pwd_hint"
  android:maxLines="1"
  android:inputType="textPassword" />
 </android.support.design.widget.TextInputLayout>
레이아웃 에 속성app:passwordToggleEnabled=”true”을 추가 하면 EditTextinputType=”textPassword”를 입력 할 때 입력 상자 의 맨 오른쪽 에 눈 과 같은 스위치 를 표시 하고 비밀 번 호 를 숨 길 수 있 습 니 다.필요 한 학생 은 해 보 세 요.
참고:
http://stackoverflow.com/questions/39019675/remove-show-password-icon-in-android-n
관련 읽 기:
Android EditText 소프트 키보드 에 가 려 지 는 처리 방법
Android 에서 EditText 는 명문 과 비밀 번 호 를 표시 하 는 두 가지 방식 입 니 다.
위 에서 말 한 것 은 편집장 이 소개 한 안 드 로 이 드 에서 EditText 비밀 번 호 를 숨 기 는 방법 입 니 다.여러분 에 게 도움 이 되 기 를 바 랍 니 다.궁금 한 점 이 있 으 면 메 시 지 를 남 겨 주세요.편집장 은 바로 답 해 드 리 겠 습 니 다.여기 서도 저희 사이트 에 대한 여러분 의 지지 에 감 사 드 립 니 다!

좋은 웹페이지 즐겨찾기