I'm using the above property in my TextInputLayout
theme to make the underline color of the TextInputLayout
green when activated.
<item name="colorControlActivated">#27e905</item>
Its works fine and I get the following result
But as you can see colorControlActivated
also affects the floating hint color. I need a different color for floating hint. Is there any way t do so?
Update 2021
You can use this attribute to control the underline color
app:boxStrokeColor="@color/green"
add these styles in styles.xml
<style name="textInputLayout.GrayLabel"
parent="Widget.Design.TextInputLayout">
<item name="hintTextAppearance">@style/AppTheme.TextFloatLabelAppearance</item>
</style>
<style name="AppTheme.TextFloatLabelAppearance"
parent="TextAppearance.Design.Hint">
<!-- Floating label appearance here -->
<item name="android:textColor">@color/YOUR_COLOR</item>
<item name="android:textSize">@dimen/YOUR_TEXT_SIZE</item>
</style>
and use it like this:-
<android.support.design.widget.TextInputLayout
style="@style/textInputLayout.GrayLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen_8dp">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With