how to hide navigationbar when i push from navigation controller?

senthilMuthu picture senthilMuthu · Oct 24, 2009 · Viewed 31.4k times · Source

how to hide top bar in UIViewcontroller when i push from navigation controller using pushViewController ? any help please?

Answer

Ed Marty picture Ed Marty · Oct 24, 2009

Put this code in the view controller you want to hide the navigation bar for.

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

And you may also want to stick this in there, depending on your needs:

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