how to hide navigationbar when i push from navigation controller?

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];
}

Leave a Comment