IOS7 UISplitViewController Status Bar

I am trying to add a splitview controller as a child view controller. The parent view controller is the navigation controller. The navigation bar is hidden for the parent view controller, and I wanted to show the status bar as the iOS 6 standard. I added the splitview controller as the child view controller, because I wanted to click on another view controller from the splitview controller.

The problem I am facing is i when I add a splitview controller, overlapping state on the content. setting edgeForExtendedLayout to UIRectEdgeNone for masterview, detailview, parentview, splitview doesn't seem to work.

Please let me know a solution that I can apply to prevent the content from matching with the status bar and show the status bar as ios 6 standards.

I tried to do this using MGSplitViewController, but ran into the same problem.

Thanks.

+7
ios7 statusbar uisplitviewcontroller
source share
3 answers

I have the same problem and I was able to solve this problem. I have a UITabBarController in the root directory with another UISplitViewController on each of the first two tabs. For some of my details views, I had overlap with both the navigation bar at the top and the tab bar at the bottom.

I first tried setting edgesForExtendedLayout , but to no avail, but it turns out you need to set it as early as possible so that it has an effect. You did not indicate in your question exactly where you are setting your property, so I hope this helps you too: set edgesForExtendedLayout in UIRectEdgeNone to -viewDidLoad your UIViewController.

This is the code that fixed it for me, and previous attempts to do this in -viewWillLayoutSubviews had no effect:

 - (void)viewDidLoad { [super viewDidLoad]; // Prevent detail screen from sitting underneath navigation bar and tab bar: self.edgesForExtendedLayout = UIRectEdgeNone; } 

Hope this helps ...

Eric

+1
source share

When you speak:

I am trying to add a view controller as a child view controller.

Do you mean setting UISplitViewController as rootViewController? If this is not so, then why is it strange.

However, the UISplitViewControllers are not designed to work this way, see this answer https://stackoverflow.com/a/464618/

I would use a container view controller to create a split view user controller: https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html

Download good links here: Container Controller Examples

Obviously, the need to recreate it is a little annoying, but at least you have complete control over its behavior.

0
source share

I think you should use parental control viewcontrollers, and a child with the navigation controller turned on can help you. If not, try this tutorial . It helps a lot, I hope it helps you too.

0
source share

All Articles