-6

My question is - How to change disables EditText underline color on 17 API? I have tried with styles and didn't look for disabled param. Any suggestions?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

2 Answers2

2

You can set edittext background transprent to remove underline

android:background="@android:color/transparent"
SahdevRajput74
  • 754
  • 7
  • 18
1

Taking answer from here

Below API level 21

To set the color:

editText.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);

To remove the color:

editText.getBackground().clearColorFilter();

Note: when the EditText has focus on, the color you set won't take effect, instead, it has a focus color.

nimi0112
  • 2,065
  • 1
  • 18
  • 32
  • Its not sloves my problem. Now underline is grey, i need it white, your solution do not make anything. android:background="@color/white" makes all view white! – Ivan Sablin Mar 06 '18 at 07:12