使用 Glide 旋转屏幕 android 设备时图像模糊
Images are blurry when rotate the screen android device with Glide
我使用 glide 在适配器中加载可绘制图像(错误发生在图像不在 recyclerview 中):
Glide.with (holder.ivPreview) .load (mThemeDrawableIds.get (position)).into (holder.ivPreview)
录制时mThemeDrawableIds会重新加载并再次通知。但是,与原始图像相比,图像模糊。
我尝试清除缓存,但结果还是一样。
将 android:adjustViewBounds="true" 添加到 XML 中的 ImageView 可能会有所帮助。
也试试这个代码:
Glide.with(imageView).load(mThemeDrawableIds.get (position))
.apply(new RequestOptions()
.fitCenter()
.format(DecodeFormat.PREFER_ARGB_8888)
.override(Target.SIZE_ORIGINAL))
.into(holder.ivPreview);
我使用 glide 在适配器中加载可绘制图像(错误发生在图像不在 recyclerview 中):
Glide.with (holder.ivPreview) .load (mThemeDrawableIds.get (position)).into (holder.ivPreview)
录制时mThemeDrawableIds会重新加载并再次通知。但是,与原始图像相比,图像模糊。
我尝试清除缓存,但结果还是一样。
将 android:adjustViewBounds="true" 添加到 XML 中的 ImageView 可能会有所帮助。
也试试这个代码:
Glide.with(imageView).load(mThemeDrawableIds.get (position))
.apply(new RequestOptions()
.fitCenter()
.format(DecodeFormat.PREFER_ARGB_8888)
.override(Target.SIZE_ORIGINAL))
.into(holder.ivPreview);