加载圆形图片:

RequestOptions mRequestOptions = RequestOptions.circleCropTransform()
.diskCacheStrategy(DiskCacheStrategy.NONE)//不做磁盘缓存
.skipMemoryCache(true);//不做内存缓存
Glide.with(mContext).load(userInfo.getImage()).apply(mRequestOptions).into(mUserIcon);

效果:

 Glide加载圆形、圆角图片

分割字符串加载图片

Glide.with(context).load(mlist.get(i).getImages().split("\|")[0].replace(“https”, “http”)).into(carShopViewHodler.mImage);

加载圆角图片

//设置图片圆角角度
RoundedCorners roundedCorners= new RoundedCorners(6);
//通过RequestOptions扩展功能,override:采样率,因为ImageView就这么大,可以压缩图片,降低内存消耗
RequestOptions options=RequestOptions.bitmapTransform(roundedCorners).override(300, 300);
 
Glide.with(context).load(files.getFilePath()).apply(options).into(mUserPhoto);

效果:

Glide加载圆形、圆角图片

相关文章:

  • 2021-05-27
  • 2021-04-18
  • 2021-05-28
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2021-07-15
  • 2021-05-27
  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
  • 2021-09-26
相关资源
相似解决方案