- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:animated];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:NO animated:animated];
}
注意,animated设为YES,仍是会有一个瞬间的过渡效果。只有设置为animated才能真正实现。
另外,把你的navagiatioincontroller的类型设置成不显示navigationbar的.
摘录于:http://www.cocoachina.com/bbs/read.php?tid=99139