Glide.with(context).load(url).asBitmap().centerCrop().into(new BitmapImageViewTarget(imageView) { @Override protected void setResource(Bitmap resource) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), resource); circularBitmapDrawable.setCircular(true); imageView.setImageDrawable(circularBitmapDrawable); }
});
如果使用第三方的圆形头像控件,或者自定义圆形头像控件要注意问题,参考这个博客
http://blog.csdn.net/jeffleo/article/details/52097151
自己记录,以备再再次踩坑里了
Glide 加载圆形头像方法
最新推荐文章于 2024-06-28 16:47:58 发布