应用场景:当A控制器导航栏是隐藏的,push到B控制器(B导航栏是不隐藏的)
//不要直接这样使用
self.navigationController.navigationBar.hidden = YES;(or NO)
//正确的平滑过度方式如下
- (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:YES];
}