我想使用Glide加载动态高度的图像。我有一个ImageView,其高度为wrap_content,宽度为match_parent。当回收者视图第一次加载时。第一张图像的高度高于其他图像的高度。当我向下滚动视图得到回收时,我的较大高度图像加载精细而没有任何像素化当我向后滚动到顶部到第一个更大的图像时它变得像素化我认为当视图被回收滑动时使用较小的回收器imageview高度用于下采样较大的高度由此得到像素化的图像。我不想在recyclerview上使用setRecyclable(false)。这是实施
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/drc_imageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@color/OFF_WHITE" />
</LinearLayout>
用于加载图像
GlideApp
.with(context)
.asBitmap()
.fitCenter()
.load(absoluteHomeList.get(position - 1).getDynamic_card_url())
.into(holder.dynamicImageView);
在使用滑行使用加载图像之前
holder.dynamicImageView.layout(0,0,0,0);