Search code examples
androidandroid-textinputlayoutmaterial-components-android

How to change underline color error textinputlayout android


I would like to know how to change the error color of the TextInputLayout underline.

TextInputLayout with error


Solution

  • Just use the app:boxStrokeErrorColor attribute:

        <com.google.android.material.textfield.TextInputLayout
            app:boxStrokeErrorColor="@color/primaryLightColor"
            ...>
    

    enter image description here

    It requires Material Components lirabry version 1.2.0.