亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Android中實(shí)現(xiàn)EditText密碼顯示隱藏的方法

Original 2017-01-13 11:31:25 650
abstract:在Google發(fā)布了support:design:23+以后我們發(fā)現(xiàn)有這么一個東西TextInputLayout,先看下效果圖:<android.support.design.widget.TextInputLayout   android:id="@+id/pwdLayout"   android:layout_width=&qu

在Google發(fā)布了support:design:23+以后我們發(fā)現(xiàn)有這么一個東西TextInputLayout,先看下效果圖:

2017010615271612.png

<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”就可以實(shí)現(xiàn)當(dāng)EditText的inputType=”textPassword”的時候在輸入框的最右邊就會顯示眼睛一樣的開關(guān)來顯示和隱藏密碼,需要的同學(xué)不妨試試看。

更多關(guān)于Android中實(shí)現(xiàn)EditText密碼顯示隱藏的方法請關(guān)注PHP中文網(wǎng)(ipnx.cn)其他文章!

Release Notes

Popular Entries