tags:

views:

522

answers:

1

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

+8  A: 

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];
}
Ed Marty
I would like to add to the question, how to make it hide/show when the user taps towards where it is. Ie: like in the photos app.
JoePasq
You just put that setNavigationBarHidden call wherever you like, when you need to hide the nav bar.
Kendall Helmstetter Gelner