Pretty much I have an application where you press a button and it adds 2 separate editTexts to the current layout but I am stuck with using a dark background as the default theme has a white underline. I cannot change the color of the editTexts and am stuck with a theme color I don't want.
Asked
Active
Viewed 89 times
1
Anis LOUNIS aka AnixPasBesoin
- 4,765
- 5
- 32
- 61
user3042332
- 81
- 1
- 7
1 Answers
0
I suppose you're creating your EditTexts dynamically (as you said in your question).
You just have to mutate the background of your newly created EditText. This can be achieved as follows:
yourEditText.getBackground()
.mutate()
.setColorFilter(getColor(R.color.someColor), PorterDuff.Mode.SRC_ATOP);
Related question
Community
- 1
- 1
Anis LOUNIS aka AnixPasBesoin
- 4,765
- 5
- 32
- 61
-
Amazing! Works exactly as needed! just getColor is depreciated now though. – user3042332 Feb 01 '17 at 02:11