Reputation: 23
I would like to know how to change the error color of the TextInputLayout underline.
Upvotes: 0
Views: 1803
Reputation: 363745
Just use the app:boxStrokeErrorColor
attribute:
<com.google.android.material.textfield.TextInputLayout
app:boxStrokeErrorColor="@color/primaryLightColor"
...>
It requires Material Components lirabry version 1.2.0
.
Upvotes: 4
Reputation: 3767
You can change the color in the edittext background as such. This background makes the underline to disappear. But you can make it to whatever color you want.
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_horizontal_margin"
app:hintEnabled="false">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Floating Hint Disabled"
android:background="@android:color/transparent" />
</android.support.design.widget.TextInputLayout
Upvotes: 1