【发布时间】:2016-03-24 11:06:18
【问题描述】:
以前在 23.2.0 中可以设置色调。当我将版本更改为 23.2.1 时,以下代码不再着色我的 ImageView。
我有一个定义为
的图像视图列表List<ImageView> statusStage = new ArrayList<>();
然后我使用以下方法更新图像色调。
public void setStatusStage(int stageComplete, int colorOn ) {
for (int i = 0; i < statusStage.size(); i++) {
ImageView ss = statusStage.get(i);
Drawable dr = DrawableCompat.wrap(ss.getDrawable());
DrawableCompat.setTint(dr, colorOn);
print("stage Complete:" + stageComplete+", "+i);
}
}
现在setTint的方式不一样了吗? 我需要更改我的代码以使其适用于新版本?
有 bug 的 appcompat 版本。
compile 'com.android.support:appcompat-v7:23.2.1'
【问题讨论】:
标签: android android-support-library android-appcompat