我从导航控制器推送时如何隐藏导航栏? [英] how to hide navigationbar when i push from navigation controller?
本文介绍了我从导航控制器推送时如何隐藏导航栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用
pushViewController 从导航控制器推送时,如何在 UIViewcontroller 中隐藏顶部栏?
有什么帮助吗?
how to hide top bar in UIViewcontroller when i push from navigation controller using pushViewController ? any help please?
推荐答案
将此代码放在要隐藏导航栏的视图控制器中。
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];
}
这篇关于我从导航控制器推送时如何隐藏导航栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文