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:
- Connect first image view's
top
to superview's top
,
- Connect last image view's
bottom
to superview's bottom
,
- Set
equal heights
for all image views.
Oh, and don't forget to set some constraints for horizontal axis.
Add the constraints as the image below
Select all of the image first and give constraint as below
Step 1
Step 2
Step 3: You will achieve what you wants