Lalalalalala Lalalalalala - 1 year ago 46
iOS Question

Navigation bar disappears when pushing to the next viewController

Currently the home page of my application hides the navigation bar; however, whenever I attempt to push that controller over to the next viewController it also hides that navigation bar too. I currently have this is the view controller WITHOUT a navigation bar:

[self.navigationController pushViewController: mapView animated:YES];

Whenever this pushes to the next one it does not have one anymore. The next viewController's navigation bar is in the
method, so it should show up. Any ideas?


If you hide your navigation bar in a ViewController and wish to show it in the next one then use the following code:

someVC *VC = [[someVC alloc] init];
[self.navigationController pushViewController: VC animated:YES];

@LithuT.V and @Tendulkar Thank you!

Answer Source

Write this code in the ViewDidload method of mapView

[self.navigationController.navigationBar setHidden:NO];