Answers for "how to change the color of a drawable programmically"

0

how to change the color of a drawable programmically

Drawable unwrappedDrawable = AppCompatResources.getDrawable(context, R.drawable.my_drawable); 
Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
DrawableCompat.setTint(wrappedDrawable, Color.RED);
Posted by: Guest on January-21-2021

Code answers related to "how to change the color of a drawable programmically"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language