Issue
I am trying to set the background color of a button in my app and I am unable to achieve the result that I want...
The color that I am trying to set is holo_green_light(#ff99cc00)
. In order to do it, I am using setColorFilter(0xff99cc00, PorterDuff.Mode.MULTIPLY);
The color that I get is not the holo_green_light
but a mix of lightgrey and holo_green_light
.
I have tried using the LightingColorFilter
without much success.
Is there a way to do it programatically, so that the button appears like a button and not a flat rectangle with the color that I need.
Solution
If you want to keep the general styling (rounded corners etc.) and just change the background color then I use the backgroundTint property
android:backgroundTint="@android:color/holo_green_light"
Answered By - Mark Proctor
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.