Reputation: 245
I prototype an app and navigation and my UIImageView in ViewControllers, which I created in Storyboard (Xcode 6) does not stretch to full screen. For example, I have UIImageView with 640×1136 image. If I run it on iPhone 5, it shows me full screen. But if I run it on iPhone 6 or 6 Plus, it locates in top left corner. I read so many topics and articles, but nothing helped.
Upvotes: 2
Views: 5923
Reputation: 907
use AutoLayout and add all four constraint(top right,left,bottom) on it.
Upvotes: 0
Reputation: 2304
Make sure your UIImage
is in an UIImageView
and then either add constraints or change the content mode like this:
myImageView.contentMode = UIViewContentModeScaleAspectFit;
Or change it in the story board in the attributes inspector under view.
Here is a list of all the values you can set for this property.
Edit: reading your issue over, I think you definitely need to add constraints to your view. There are lots of tutorials on how to do this: here is apples.
You add your constraints by clicking the pin menu, and then clicking on the four red brackets and clicking "Add Constraints".
Upvotes: 6