android - Scaling images in an image view with a fixed width -


I have many images Load the audio in I ListActivity Now this is the fact that the images have different aspect ratios.

I would like to display all the images with the same width set in XML (to fit in my layout), whereas they should take as much space as they need. Is there any way to do this in XML?

Thank you!

I think you should have android: scaleType = "fitCenter"

to SDK docs:

Calculating a scale that will maintain the original source aspect ratio, but also ensure that the src is fully fit within DST. At least one axis (X or Y) will fit exactly, the result is concentrated inside DST.

Therefore, I think that if you set a width on the image view, but set the height in the ramp-content, then what should you do with the scaletipe fitted center?

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -