Answers for "android set tint color programmatically"

0

how to change background tint color programmatically android

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);
Posted by: Guest on February-05-2021
0

changing tint of image programmatically

imageView.setColorFilter(ContextCompat.getColor(context, R.color.COLOR_YOUR_COLOR), android.graphics.PorterDuff.Mode.SRC_IN);
Posted by: Guest on December-24-2020

Code answers related to "android set tint color programmatically"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language