bugfixr bugfixr - 3 months ago 18
iOS Question

Gray bar caused by NavigationController at bottom of screen

In my iPad app, I'm using a

UITabBarController
, with some of the tabs being a
UISplitViewController
. I've noticed when I embed my split views into a Nav controller I end up with a gray bar that spans the bottom of my screen that I cannot get rid of it.

For example, this:

Storyboard with one embedded Nav controller

Produces this:

Gray bar example

Now, if I go in and embed the detail side into a nav controller, here's the result:

2nd Example

I've tried everything I can think of and that gray bar at the bottom just won't go away. Anyone have any tips?

Answer

Subclass UISplitViewController and add:

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.extendedLayoutIncludesOpaqueBars = YES;
}

or

- (BOOL)extendedLayoutIncludesOpaqueBars
{
    return YES;
}