I am using UISplitViewController and UIContainerView as shown in fig.
Code for displaying this is:
self.slidingViewController.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"SplitContainerVC"];
It am Pretty sure auto layouts for container view are accurate.
Why my content view (search bar etc) is beneath UINavigation bar
? Please see attached fig.
I have removed following code and its work fine:
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
return NO;
}
But i need this above code. What's an issue behind this?
Starting in iOS 8 you should use preferredDisplayMode. As shouldHideViewController
is deprecated in iOS8.
To show both view controllers in portrait mode do the following:
self.splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;
Hope this helps!