4

I have a view controller that is embedded in a UINavigationController,how can I hide the UINavigationBar? I want the navigation functionality but I don't want that bar in the top..

tnx

rmaddy
  • 314,917
  • 42
  • 532
  • 579
nick shmick
  • 905
  • 1
  • 9
  • 25
  • Have you looked at the API docs for `UINavigationController`? There are methods to show/hide the navigation bar. – rmaddy Dec 16 '14 at 22:26

2 Answers2

8

This should work:

[self.navigationController setNavigationBarHidden:YES animated:YES];

to get it back, just call:

[self.navigationController setNavigationBarHidden:NO animated:YES];

source: How to hide the UINavigationBar for my first view

Community
  • 1
  • 1
aplr
  • 320
  • 1
  • 8
0

To hide navigationBar you can use below code

 [self.navigationController setNavigationBarHidden:YES animated:YES];

To Unhide navigationBar you can use below code

 [self.navigationController setNavigationBarHidden:NO animated:YES];

By implement this code in your ViewController you can hide specific viewController Actually the trick is , hide the navigationBar when that Controller is launched

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

and unhide the navigation bar when user leave that page do this is viewWillDisappear

- (void)viewWillDisappear:(BOOL)animated {
    [self.navigationController setNavigationBarHidden:NO animated:YES];
    [super viewWillDisappear:animated];
}
Dhiru
  • 3,040
  • 3
  • 25
  • 69