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
2009-10-24 17:18:53
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
2009-10-24 17:44:43
You just put that setNavigationBarHidden call wherever you like, when you need to hide the nav bar.
Kendall Helmstetter Gelner
2009-10-24 22:10:15