[New post] Java code snippet – How to change background tint color programmatically android?
Subash Chandran posted: " Drawable buttonDrawable = button.getBackground(); buttonDrawable = DrawableCompat.wrap(buttonDrawable); //the color is a direct color int and not a color resource DrawableCompat.setTint(buttonDrawable, Color.RED); button.setBackground("
Drawable buttonDrawable = button.getBackground(); buttonDrawable = DrawableCompat.wrap(buttonDrawable); //the color is a direct color int and not a color resource DrawableCompat.setTint(buttonDrawable, Color.RED); button.setBackground(buttonDrawable);
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.