本文介紹了移除 Android N 中的顯示密碼圖標(biāo)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
限時(shí)送ChatGPT賬號(hào)..
當(dāng)我在 EditText 視圖中設(shè)置 android:inputType="textPassword"
時(shí),新的 Android 版本會(huì)自動(dòng)繪制顯示密碼圖標(biāo).我怎樣才能禁用它?謝謝
New Android version automatically draws show password icon when I set android:inputType="textPassword"
in EditText view. How can I disable it? Thanks
推薦答案
使用setPasswordVisibilityToggleEnabled
或 app:passwordToggleEnabled
通過 XML.
The password icon (or eye-icon) use be removed with the method setPasswordVisibilityToggleEnabled
or with app:passwordToggleEnabled
through XML.
有關(guān)詳細(xì)信息,請(qǐng)參閱支持庫(kù)修訂.
For more information see support library revisions.
例子:
<android.support.design.widget.TextInputLayout
android:id="@+id/new_password_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true"
app:passwordToggleEnabled="false">
<EditText
android:id="@+id/password_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/new_password"
android:imeOptions="actionNext"
android:inputType="textPassword"
android:singleLine="true"/>
</android.support.design.widget.TextInputLayout>
這篇關(guān)于移除 Android N 中的顯示密碼圖標(biāo)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!