版權聲明:本文爲xing_star原創文章,轉載請註明出處!html
本文同步自http://javaexception.com/archives/207java
Glide.with(picViewHolder.imageView.getContext()).load(url) .asBitmap().centerCrop() .into(new BitmapImageViewTarget(picViewHolder.imageView) { @Override protected void setResource(Bitmap resource) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(picViewHolder.imageView.getResources(), resource); circularBitmapDrawable.setCornerRadius(SystemUtils.dip2px(3)); picViewHolder.imageView.setImageDrawable(circularBitmapDrawable); } });
Glide.with(this.context) .load(url) .apply(RequestOptions.bitmapTransform(new RoundedCorners(14))) .into(ImageView);