【发布时间】:2020-03-22 14:47:07
【问题描述】:
我正在尝试在首选项屏幕中使用 TextInputLayout,以便拥有一个漂亮整洁的密码框,其中包含显示密码选项。我知道有一些方法和方法可以使用复选框和脚本来做到这一点,但我真的很想只使用 TextInputLayout,可能是包装的或自定义的小部件。 Gradle 依赖项是正确的,因为它在其他活动屏幕中运行良好。
以下preferences.xml 因“错误膨胀类com.google.android.material.textfield.TextInputLayout”而崩溃
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</androidx.preference.PreferenceScreen>
【问题讨论】:
标签: android kotlin preferencescreen textinputlayout