大佬教程收集整理的这篇文章主要介绍了ios – 点击手势以隐藏导航栏,标签栏和状态栏,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
- (void)toggleBars:(UITapGestureRecognizer *)gesture { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; BOOL statusBarHidden = YES; BOOL barsHidden = self.navigationController.navigationBar.hidden; [self.navigationController setNavigationBarHidden:!barsHidden animated:YES]; BOOL tabBarHidden = self.tabBarController.tabBar.hidden; [self.tabBarController.tabBar setHidden:!tabBarHidden]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. UIBarButtonItem *systemAction = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@SELEctor(showMenu)]; self.navigationItem.rightBarButtonItem = systemAction; UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@SELEctor(toggleBars:)]; [webView addGestureRecognizer:singleTap]; singleTap.delegate = self; } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; }
[[UIApplication sharedApplication] setStatusBarHidden:![[UIApplication sharedApplication] isStatusBarHidden] withAnimation:UIStatusBarAnimationSlide]; [self.navigationController setNavigationBarHidden:!self.navigationController.navigationBar.hidden animated:YES];
此外,我不确定您的标签栏没有正确隐藏的详细信息,但我确实找到了以下类别,声称能够隐藏带有选项动画的标签栏.
https://github.com/idevsoftware/Cocoa-Touch-Additions/tree/master/UITabBarController_setHidden
以上是大佬教程为你收集整理的ios – 点击手势以隐藏导航栏,标签栏和状态栏全部内容,希望文章能够帮你解决ios – 点击手势以隐藏导航栏,标签栏和状态栏所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。