1

style="@style/Widget.Design.TextInputLayout"forを使用するとTextInputLayout、設定app:errorIconDrawableは何もしません。スタイルを設定せず、アプリケーションのテーマを継承させた場合にのみ機能します ( Theme.MaterialComponents.Light.NoActionBar)。app:endIconDrawableも機能せず、この問題の代替/解決策が見つかりません。助けてください!


アプリケーションのテーマを継承しながら、次のように動作します:Theme.MaterialComponents.Light.NoActionBarしかし、私はこのスタイルを望んでいません。

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/login_password_input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="username"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/login_password_input_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

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

ここに画像の説明を入力


これは必要なスタイルを使用しますが、エラー アイコンは表示されません。

<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/login_password_input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="username"
    style="@style/Widget.Design.TextInputLayout"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/login_password_input_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

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

ここに画像の説明を入力

4

2 に答える 2