一.要实现这个功能,首先需要添加这个库
dependencies {
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
}
二.在类中添加
//圆形头像的Glide使用条件 RequestOptions mRequestOptions = RequestOptions.circleCropTransform();
然后在需要使用圆形头像的地方使用
Glide.with(mContext).load(userInfo.getImage()).apply(mRequestOptions).into(mUserIcon);
上面()里的内容根据自己的项目去修改