当 EditText 的输入类型为密码时,Android 回话宣布 TextInputLayout 的内容描述不正确

问题描述

我的 Android 应用中有一个具有以下结构的 TextInputLayout。

<com.google.android.material.textfield.TextInputLayout
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionDone"
        android:id="@+id/mEdit"
        android:inputType="numberPassword"
        android:maxLength="4"
        android:singleLine="true"
        app:layout_constraintTop_toTopOf="parent" />

</com.google.android.material.textfield.TextInputLayout>

这里 maxLengthEditText4。但是,在启用对话后,如果我们尝试在密码字段中编辑某些内容,即使我们没有达到 { maxLength 中的 {1}}。

Incorrect content description is shown when we enter 3rd password charector

预先感谢您提出宝贵意见。

解决方法

com.google.android.material.textfield.TextInputEditText 中使用 EditText 而不是 TextInputLayout

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...