这是我用来在其中一个视图中隐藏导航栏的空白。
- (void)viewWillAppear:(BOOL)animated {
[self.navigationController setNavigationBarHidden:YES];
[super viewWillAppear:animated];
}
如何点按屏幕隐藏并显示导航栏?
答案 0 :(得分:3)
你想要那样的东西吗?
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBar.translucent = YES;
self.wantsFullScreenLayout = YES;
UITapGestureRecognizer *tap = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideShowNavigation)] autorelease];
tap.numberOfTapsRequired = 1;
[self.view addGestureRecognizer:tap];
}
- (void) hideShowNavigation
{
[self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden];
}