标签:
这个问题曾经困扰过我。现在我给出正解。
- (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才能真正实现。
2、
[self.navigationController setNavigationBarHidden:YES animated:YES];
[self.navigationController setNavigationBarHidden:NO animated:YES];
3、
self.navigationController.navigationBarHidden = YES;用来隐藏;
self.navigationController.navigationBarHidden = NO;用来显示
标签:
原文地址:http://www.cnblogs.com/zhaoweizheng/p/4601495.html