gpt4 book ai didi

iphone - 通过点击手势隐藏和显示导航栏

转载 作者:行者123 更新时间:2023-12-03 20:52:09 24 4
gpt4 key购买 nike

Possible Duplicate:
Hide/Show Navigation & Tool Bar on tap

这是我用来隐藏其中一个 View 中的导航栏的空白。

- (void)viewWillAppear:(BOOL)animated {
[self.navigationController setNavigationBarHidden:YES];

[super viewWillAppear:animated];
}

如何点击屏幕隐藏和显示导航栏?

最佳答案

你想要这样的东西吗?

- (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];
}

关于iphone - 通过点击手势隐藏和显示导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11128536/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com