Reputation: 42139
I have a UITabViewController which contains a UISplitViewController as the first view. When the app loads and shows the split controller, the top of the two views are cut off and shifted down a maybe 15 pixels. Clicking another tab fixes the problems and jumps both views back up:
When app loads:
After clicking another tab problem is corrected:
Code being used (unimportant stuff left out):
NewsSplit *newsTemp = [[NewsSplit alloc] init];
...
// The view controllers to the tabBar
[tabController setViewControllers:[NSArray arrayWithObjects:newsSplit, eventSplit, classesSplit, dirSplit, settings, nil]];
...
self.window.rootViewController = self.tabController;
[self.window makeKeyAndVisible];
Why would the top be cut off and shifted down?
Upvotes: 0
Views: 396
Reputation: 8677
The short of it is that UISplitViewController
isn't supposed to be embedded within another view controller. It's meant to be the root view controller of your window. I've run into this exact same issue in the past. Support for things such as rotation was glitchy. I eventually got it working like I wanted, but it was a hassle.
Unless they've improved things, I think you're going to have to subclass some things and shift frames around to get it to look right.
Upvotes: 2