0

I have EditTexts and they color the bottom line in primary color as you can see here

I want to leave it black, so I set in my layout for the EditText:

android:backgroundTint="@android:color/black"

This works nice, but I have minSDK set to 19. So I immediately get a warning that this would not work for API < 21

How can I solve this for API 19 and API 20 as well?

Community
  • 1
  • 1
Tranquillo
  • 235
  • 2
  • 13

1 Answers1

0

I used a code like this, and it works for me:

yourEditText.getBackground().setColorFilter(getResources().getColor(android.R.color.black), PorterDuff.Mode.SRC_IN);

I hope it works to you