Rohit Gupta
Rohit Gupta

Reputation: 1378

how to change the color of underline of TextInputLayout?

how do I change the color of underline of TextInputLayout?

I have tried to set colorControlNormal, colorControlActivated, colorControlHighLight in themes but it does not work.

I want to set the color of underline white instead of black: enter image description here

Upvotes: 1

Views: 6561

Answers (6)

AskNilesh
AskNilesh

Reputation: 69689

please apply a custom theme in your text input layout

example

    <style name="MYAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorControlNormal">#c5c5c5</item>
    <item name="colorControlActivated">@color/colorPrimary</item>
    <item name="colorControlHighlight">@color/colorPrimaryDark</item>
</style>

Upvotes: 3

Deewankshi Sharma
Deewankshi Sharma

Reputation: 95

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#FFFFFF</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">#FFFFFF</item>
</style>

Upvotes: 0

Ratilal Chopda
Ratilal Chopda

Reputation: 4220

Try this my friend

<style name="MYAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#FF0000</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">#FF0000</item>

Upvotes: 0

Blackbelt
Blackbelt

Reputation: 157437

I have a style for that where I override

 <style name="FormLabel"> 
    <item name="colorControlNormal">@color/white</item>
    <item name="colorControlActivated">@color/white</item>
    <item name="colorControlHighlight">@color/white</item>
 </style>

and I set this style to the EditText wrapped around the TextInputLayout.

Upvotes: 1

Rameshbabu
Rameshbabu

Reputation: 611

To change bottom line color, you can try this in your app Theme like below:

<style name="Theme.App.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorControlNormal">#fffff</item>
<item name="colorControlActivated">#fffff</item>
<item name="colorControlHighlight">#fffff</item>
</style>

Upvotes: 1

Harsh Singhal
Harsh Singhal

Reputation: 567

use backgroundTint .

android:backgroundTint="@color/white"

Upvotes: 1

Related Questions