Glide 第一次只加载显示 placeholder 的解决

xiaoxiao2025-08-28  16

问题

在使用 Glide 的过程中,出现图片加载的时候,在第一次加载的时候,就只会显示 placeholder 的图片。

具体场景

在评论中显示用户的头像,我使用得是第三方的CircleImageView,之后也替换成SDK提供的内置的CircleImageView,发现都是有这个问题的。

解决

最终,我使用了最初的 ImageView,而圆形的问题使用 Glide BitmapTransForm 解决了。

compile'jp.wasabeef:glide-transformations:2.0.1'

Glide.with(mContext).load(CommonUtils.getImageUrlByName(url).crossFade().centerCrop().bitmapTransform(new CropCircleTransformation(mContext)).placeholder(R.drawable.default_user_red).into(holder.mAvatar);

转载请注明原文地址: https://www.6miu.com/read-5035371.html

最新回复(0)