当我使用导航控制器推送时,如何在 UIViewcontroller 中隐藏顶部栏pushViewController ?请问有什么帮助吗?
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];
}
这篇关于当我从导航控制器推送时如何隐藏导航栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!