【问题标题】:how to toggle password visibility in android studio 3.6如何在 android studio 3.6 中切换密码可见性
【发布时间】:2020-05-03 10:11:31
【问题描述】:

我曾尝试使用该功能在 android studio 3.6.3 中切换密码可见性,但由于一些新的升级功能,我无法切换密码可见性。 所以我需要帮助来获得这个切换选项。

【问题讨论】:

  • due to some new upgrades features I'm not able to <x> 就像 以前工作过?最新成功使用的版本是什么?

标签: android-studio-3.6


【解决方案1】:

我不确定您要问的是如何在 TextInputLayout 上切换密码可见性,但这对我有用。

使用 TextInputLayout 和 TextInputLayout 你可以这样做

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/layout_password"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Password"
    app:passwordToggleEnabled="true">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:backgroundTint="@color/lightGrey"
        android:freezesText="true"
        android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout>

重要的属性是TextInputLayout中的app:passwordToggleEnabled="true"

我希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2020-03-29
    • 1970-01-01
    • 1970-01-01
    • 2022-06-15
    • 2017-05-13
    • 1970-01-01
    • 2017-04-27
    • 1970-01-01
    • 2017-05-11
    相关资源
    最近更新 更多