📌  相关文章
📜  如何以编程方式更改背景色调 android - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:42.851000             🧑  作者: Mango

代码示例1
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);