cohen72
cohen72

Reputation: 2988

UIViewController inside UINavigationController Jumps down when application returns from background

When my app returns from background, the UIViewController jumps down the height of the UINavigationBar (44 pixels).

Everything is being controlled through a story board using push segues.

Even when I NSLog the frame of both the view controller and the navigation controller after the "jump", using NSStringFromCGRect, they both show (0,0,320,480) as their frame, even though its clearly not the case.

Before:

enter image description here

After returning from background:

enter image description here

Upvotes: 1

Views: 292

Answers (1)

Erhan
Erhan

Reputation: 906

You can use this code for hide navigation bar in YourViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    [self.navigationController.navigationBar setHidden:YES];
}

Upvotes: 2

Related Questions