Glide圆角

需要引入:
implementation ‘jp.wasabeef:glide-transformations:3.3.0’

protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_glide);

    String url = "https://avatar.csdn.net/9/7/A/3_zhangphil.jpg";

    // 原图处理成圆角.
    // 如果是四周都是圆角则是RoundedCornersTransformation.CornerType.ALL
    ImageView image = findViewById(R.id.image);
    Glide.with(this)
            .load(url)
            .apply(bitmapTransform(new RoundedCornersTransformation(200, 0, RoundedCornersTransformation.CornerType.ALL)))
            .into(image);
}

你可能感兴趣的:(Glide圆角)