0
目前,我设计我的密码输入文本字段如下如何使用setTransformationMethod(空)显示密码,但仍保留了眼睛图标
<android.support.design.widget.TextInputLayout
android:layout_marginLeft="@dimen/trading_activity_horizontal_margin"
android:layout_marginRight="@dimen/trading_activity_horizontal_margin"
app:hintTextAppearance="@style/TradingWizardTextInputLayout"
app:passwordToggleEnabled="true"
android:id="@+id/password_text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/wizard_password"
android:id="@+id/password_edit_text"
android:inputType="textPassword"
android:imeOptions="actionNext|flagNoExtractUi" />
</android.support.design.widget.TextInputLayout>
它看起来如下
但是,在初始阶段,我想让我的密码输入文本字段的输入可见。
这意味着,当密码输入文本字段第一次出现,它看起来应该是这样
我曾试图
passwordEditText.setTransformationMethod(null)
的密码是可见的。但是,它也会使眼睛图标消失!
我如何使用setTransformationMethod(null)
显示密码,但仍保留了眼睛图标?
没有。它不会改变任何东西。整个眼睛图标上仍然有一个对角十字标志,并且密码仍然不可见。 –