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>