[英]how to avoid changing textview color and Imageview color with Scrolling on recyclerview?
[英]How to avoid imageview blink in recyclerview?
我正在使用 Recyclerview 和一些 imageview 視圖。 問題是當我刷新 Recyclerview 時圖像總是閃爍。 我嘗試使用 stableID 但它不起作用,因為我有一個 model class,其中 id 是字符串格式。 我正在使用 glide 將圖像加載到 imageview。請幫助我避免 imageview 閃爍。
Glide.with(activity.requireActivity())
.load(o.picture).placeholder(R.drawable.user_icon)
.dontAnimate()
.apply(RequestOptions.bitmapTransform(BlurTransformation()))
.into(contact_img)
您可以嘗試使用 SimpleTarget
Glide
.with(context)
.load(filepath)
.asBitmap()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
.dontAnimate()
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap arg0, GlideAnimation<? super Bitmap> arg1) {
// TODO Auto-generated method stub
holder.mItemView.setImageBitmap(arg0);
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.