0
votes

I'm trying to scale the mode of an UIImageView, by default the value of the mode is Scale to Fill, in this mode my images seem to be stretched and doesn't look good, In Aspect Fill the images seem to be the best fit but when I'm in this mode the Image instead of staying 600 Width x 300 Height, it changes to a different aspect ratio, and it cover up all the data below the image. See the images below of reference:

  • Size of the Image View

enter image description here

  • Scale to Fill Mode all images are streched and cut off.

enter image description here - Aspect to Fill, same picture but as you can see it's now much bigger in Height and it cuts off the top 2 cells leaving the remaining cells, but in some other images running the same mode the pictures look crisp and perfect.

enter image description here Any thoughts or suggestions on how I can fix this problem?

1
Did you try Aspect fit? Also, are you using Auto-Layout? If so, did you add constraints? - Teodor Ciuraru
You can't fix this problem unless the image and the image view are the same size. It's the nature of image resolutions. Did you try aspect fit mode? - Desdenova
i tried Aspect Fit the image looks good but there's a chunk of white space left on right hand side of the image and a third of the image is cut off @TeodorCiuraru - Katz

1 Answers

2
votes

You need to add constraints on UIImageView. Pin your UIImageView from top, bottom, left and right.

enter image description here.

After adding constraints I would suggest to use "Aspect Fit" mode. The labels in bottom also need constraints.