Reputation: 9566
We are updating our Auto Layout-using app to natively support iPhone 6 resolution. We added the iPhone 6 launch image, and most of the views scaled nicely.
However, we are experiencing a small annoyance: when loading new view controllers, the views have the iPhone 5 resolution on the UIViewController
's viewDidLoad
method. The view only gets the iPhone 6 resolution when you hit viewWillAppear
.
Why is this? Is there anything we can configure or modify to make the views have the final resolution on viewDidLoad
already?
Upvotes: 1
Views: 1418
Reputation: 7924
I think the right place to get geometry data from your views is in the method:
- (void)viewDidLayoutSubviews;
This is called when auto layout finishes laying the views. Please beware this method can be called multiple times, i.e. after a rotation of the device.
EDIT
In interface builder, there is an option to set the size for the simulated metrics. I'm not sure if this has to do only with what interface builder displays, or also with the frame of the view at load time. Maybe you can change it and give it a try.
Upvotes: 2