0
点赞
收藏
分享

微信扫一扫

【开发笔记】解决Glide加载图片后ImageView的tint属性失效问题

木樨点点 2022-02-10 阅读 103
android

使用Glide加载图片后发现图片tint属性失效,需要重新设置,设置方法如下:

//5.0以上系统
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
	ImageView image = new ImageView(context);
	image.setImageResource(R.drawable.ic_sort_down);
	image.setImageTintList(ColorStateList.valueOf(ContextCompat.getColor(context,R.color.theme)));
}

参考文章:android tint java_在代码中实现android:tint效果

举报

相关推荐

0 条评论