📌  相关文章
📜  以编程方式设置 textview 的 setdrawableTint - 任何代码示例

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

代码示例1
private void setTextViewDrawableColor(TextView textView, int color) {
        for (Drawable drawable : textView.getCompoundDrawables()) {
            if (drawable != null) {
                drawable.setColorFilter(new PorterDuffColorFilter(ContextCompat.getColor(textView.getContext(), color), PorterDuff.Mode.SRC_IN));
            }
        }
    }