Why doesn't the height of my UIImage
change when I run it on a different device? I set the height to 187 too all 4 images and I want display them with equal heights so they fill the full screen?
Here's the constraints for each image:
The image on the right is a screen-shot taken from Xcode. The image on the left is a screen-shot on iPhone 6
UIImage
's size doesn't change because it's the same JPG/PNG file, regardless of the device. What you need is a set of proper layout constraints.I suggest the following approach:
top
to superview'stop
,bottom
to superview'sbottom
,equal heights
for all image views.Oh, and don't forget to set some constraints for horizontal axis.