到目前为止,我一直在使用CircleImageView。但是现在我需要添加背景以及SRC。这两个功能都在本机imageView中可用。但是,当我在CircleImageView中添加背景颜色时,背景变成正方形而不是圆。我尝试了许多自定义圆形图像视图,但无济于事。有什么方法可以实现这一目标吗?
使用github
的此圆形图表代码rougnedimageView
使用正常imageView检查我的代码:
Glide.with(getActivity()).load(dashBoardCompanyInfoModel.getLogo()).asBitmap().into(new BitmapImageViewTarget(ivProfile) {
@Override
protected void setResource(Bitmap resource) {
final RoundedBitmapDrawable circularBitmapDrawable =
RoundedBitmapDrawableFactory.create(getResources(), resource);
circularBitmapDrawable.setCircular(true);
ivProfile.setImageDrawable(circularBitmapDrawable);
}
});