android icon hide,Change to custom icon from eye-icon(default) for hide-show password in android Edi...

If you would like to use default eye icon (show/hide password) but change the icon color

then you simply put the line

app:passwordToggleTint="@color/yourColor"

If you would like to use custom eye icon, you should use

app:passwordToggleDrawable

to change the icon. and use

app:passwordToggleTint

to change the color of the icon. your custom icon color does not show. Tint color will be shown. The whole xml code like below:

android:id="@+id/text_input_layout_password"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:textColorHint="@color/yourColor"

android:theme="@style/TextLabelLogin"

app:hintTextAppearance="@style/TextAppearance.App.TextInputLayout"

app:passwordToggleEnabled="true"

app:passwordToggleTint="@color/yourColor"

app:passwordToggleDrawable="@drawable/show_password_selector">

android:id="@+id/etPassword"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="@drawable/bottom_line_shape"

android:hint="@string/password"

android:textColorHint="@color/yourColor"

android:inputType="textPassword"

android:textColor="@color/yourColor"/>

and show_password_selector.xml is given below:

Hope that will help all.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值