Tuesday, 25 May 2021

How to set minimum height of image view and keep "wrap_content" as height when using Glide

I get images of different sizes from server, so i used "wrap_content" for imageView height. It works perfectly fine.

The issue is that every images takes some time to load, in that time, images has no height , and it looks weird, so i need to set some minimum height of the "imageView" component.

But if set any height to the "imageView" the "wrap_content" functionality goes away, and it loads the image in same container.

I need to know the possibility to set minimum height of image view but keep the "wrap_contnet" functionality.

Glide Code

    Glide.with(context)
            .load(dataList?.get(position)?.defaultImage)
            .into(holder.ivBackgroundImage)


from How to set minimum height of image view and keep "wrap_content" as height when using Glide

No comments:

Post a Comment