0
votes

I am using UISplitViewController and UIContainerView as shown in fig.

enter image description here

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.

enter image description here

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?

1
Seeing the exact same thing minus the container view. Also have a search bar at the top. Wondering if that is meaningful. Will play with it down that path.vagrant
Are you using something like this : [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop]; ScrollPositionTop is causing an issue.Umair Suraj
I actually got stuff working by removing and re-adding the UISearchBar and turned off "Adjust scroll view insets" for the view controller in IB.vagrant

1 Answers

0
votes

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!