lbudge
lbudge

Reputation: 11

How to hide navigation bar on a particular view controller inside of navigation controller

I have 8 view controllers embedded into 1 navigation controller. I'd like to hide the navigation bar (keeping status bar) on my first view controller. When I've tried to do this this, the navigation bar disappears on all my view controllers.

Upvotes: 0

Views: 578

Answers (1)

Vlad Papko
Vlad Papko

Reputation: 13302

Try this in the first view controller:

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

Upvotes: 2

Related Questions