I am using a drawable as a background of a TextView just to have a divider line below the text. A achivied it with this drawable-xml:
Usually for similar tasks - I created layer-list drawable like this one:
-
-
The idea is that first you draw the rectangle with underlineColor and then on top of this one you draw another rectangle with the actual buttonColor but applying bottomPadding. It always works.
But when I needed to have buttonColor to be transparent I couldn't use the above drawable. I found one more solution
-
(as you can see here the mainButtonColor is transparent and white_box is just a simple rectangle drawable with white Solid)