Android DrawableCompat 着色

public static void imgSetRed(ImageView imgView) {
        if (imgView == null) return;
        WeakReference w = new WeakReference<>(imgView);
        Drawable tintIcon = DrawableCompat.wrap(w.get().getDrawable().mutate());
        DrawableCompat.setTint(tintIcon,Color.RED);
        w.get().setImageDrawable(tintIcon);
    }

你可能感兴趣的:(Android DrawableCompat 着色)