2

I have a small problem with my iPhone app. On my UIView nibs, after the in-call status bar has appeared then gone, the view doesn't resize correctly. Specifically, the top of the navigation bar is hidden underneath the status bar.

These three images show the before, during and after in-call status bar. My problem is shown in the last image. Images

I call the nib using this code:

- (IBAction)showMapClicked:(id)sender 
{
    if (childController == nil) {
        childController = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil];
    }

    [self.navigationController pushViewController:childController animated:YES];
}

I've found this SO question but it doesn't seem to cover the problem I have: Resize for in-call status bar

Thanks for any insights into how to fix.

Community
  • 1
  • 1
CharlesA
  • 4,260
  • 2
  • 25
  • 31

1 Answers1

3

I've managed to solve this one. I was using this code to hide the tab bar on the page and it was messing up the top of the page:

CGRect bounds = [[UIScreen mainScreen] bounds];
CGRect tabBarFrame = self.tabBarController.tabBar.frame;
self.tabBarController.view.frame = GRectMake(0, 0, bounds.size.width, bounds.size.height+tabBarFrame.size.height);

What I should have done was implement this:

- (BOOL)hidesBottomBarWhenPushed { return YES; }

CharlesA
  • 4,260
  • 2
  • 25
  • 31