Android – (Material) EditText underline color

androidandroid-stylesmaterial-design

My problem is that I don't know how to change underline color of EditText – I have LG Nexus 5 (Android 6).

enter image description here

I would like to change normal underline color to white. I used all params like (style):

  • colorControlNormal
  • colorControlActivated
  • colorControlHighlight
  • textColorSecondary
  • colorPrimary
  • colorPrimaryDark

e.g.

<style name="FormFont" parent="@android:style/TextAppearance.Medium">
    <item name="android:textColor">@color/white</item>
    <item name="android:textSize">@dimen/form_text_size</item>
    <item name="colorControlNormal">#c5c5c5</item>
</style>

but nothing seems to work (it only changes color when EditText us focused like in above pic).

Best Answer

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