How to round an image with Glide library?

前端 未结 22 1800
悲哀的现实
悲哀的现实 2020-11-28 00:46

So, anybody know how to display an image with rounded corners with Glide? I am loading an image with Glide, but I don\'t know how to pass rounded params to this library.

22条回答
  •  眼角桃花
    2020-11-28 01:07

    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    
    
    RequestOptions options=new RequestOptions();
            options.centerCrop().placeholder(getResources().getDrawable(R.drawable.user_placeholder));
            Glide.with(this)
                    .load(preferenceSingleTon.getImage())
                    .apply(options)
                    .into(ProfileImage);
    

提交回复
热议问题