I have a standard split view controller that I want to always show it's master view on iPads.
In the master view's viewDidLoad
, I'm calling:
self.splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;
With this one line in place, I'm getting my desired effect (always shows the master). However, a strange thing also happens: The top layout guide appears to move to the top of the master view, under the navigation bar.
You can see the effect in this picture, where the first cell in the table view is partially hidden behind the navigation bar. In fact, there is a green view above it (it's a placeholder for something that will be there soon) that is totally hidden.
If I rotate the device to landscape then back to portrait, autolayout works as expected, and the views appear in the correct place:
I've tried the following in both viewDidLoad
and viewDidAppear
to try to force the views to lay out properly, but it's had no effect:
[self.splitViewController.view setNeedsLayout];
[self.splitViewController.view layoutIfNeeded];
I'm looking for any solutions/suggestions.