0

I use MainWindow.xib for the layout of my app. I set everything on the view controller attributes simulated metrics to iPhone 3.5 retina. There is no image set for the iPhone 5 Default, yet it still tries to run the app full screen on an iPhone 5, causing the screen to be all out of sorts. Any thoughts on fixing this?

Here is on 3.5" screen:

enter image description here

Here is on 4" screen:

enter image description here

user717452
  • 33
  • 14
  • 73
  • 149

3 Answers3

1

You need the constraints on your labels and fields to be connected to the top of the view, not the bottom. By default, IB pins things to the closest edge. Use the pinning menu to achieve this, then delete the constraints that connect them to the bottom.

Alternatively you can switch to the 4" layout in IB and set things up there.

I have written about editing constraints in interface builder here, hopefully that will be useful to you.

jrturton
  • 118,105
  • 32
  • 252
  • 268
0

As for fullscreen mode, I think Xcode will put -568.png image for you, you might want to check?

As for fixing the layout, it seems that all you need is to fix top strut on all text fields, so the top position is always the same.

Dmitry Shevchenko
  • 31,814
  • 10
  • 56
  • 62
  • I'm using Autolayout and am having big time issues getting all the constraints to keep the UITextFields in the right place on the UIImageViews. – user717452 Jan 31 '13 at 04:44
  • It's harder to debug autolayout without actual nibs, but you would need to make sure your vertical space constrains are high priority and fixed – Dmitry Shevchenko Jan 31 '13 at 04:47
0

set UITextField autoresizingMask to UIViewAutoresizingFlexibleBottomMargin

recipientLabel.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
nameLabel.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
...
kukat
  • 166
  • 2
  • 4