给ImageView动态设置圆角

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaoshuxgh/article/details/80608639

现在需求就是在同一个ImageView上面有的显示圆形图标,有的显示方形图标,不能再xml布局中写成CircleImageView,所以就需要动态设置圆形:

导包:api 'com.github.bumptech.glide:glide:4.5.0'

RequestOptions requestOptions = RequestOptions.circleCropTransform();
Glide.with(App.getAppContext()).load(mImgs.get(position))
        .apply(requestOptions).into(viewHolder.imgIcon);

猜你喜欢

转载自blog.csdn.net/xiaoshuxgh/article/details/80608639