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
  • 307,833
  • 40
  • 508
  • 550
nick shmick
  • 895
  • 1
  • 8
  • 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

7

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
  • 300
  • 1
  • 7
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
  • 2,922
  • 1
  • 24
  • 64