Glide 4.7 加载圆形图片

public static void loadRoundImage(ImageView view, String url) {

    //设置图片圆角角度
    RoundedCorners roundedCorners = new RoundedCorners(30);
    //通过RequestOptions扩展功能
    RequestOptions options = RequestOptions.bitmapTransform(roundedCorners).override(300, 300)
            //圆形
            .circleCrop();
    Glide.with(view.getContext())
            .load(url).apply(options).into(view);
}

 

数值随便填,关键是circleCrop()

你可能感兴趣的:(android)