16

这两种实现有什么区别?

DrawableCompat.setTintMode(wrappedDrawable, Mode.SRC_ATOP);
DrawableCompat.setTint(wrappedDrawable, color);

drawable.setColorFilter(color, Mode.SRC_ATOP);
4

1 回答 1

0

setTint将特定 wrapedDrawable 的色调设置为int,同时setTintMode将特定 WrapedDrawable 的色调设置为ColorStateList类型。

drawable.setColorFilter设置滤色器,但该方法不一定向后兼容。

于 2015-08-10T18:38:37.053 回答