Setting navigationController.hidesBarsOnSwipe = YES never shows my navbar again(设置 navigationController.hidesBarsOnSwipe = YES 不再显示我的导航栏)
问题描述
当我设置 navigationController.hidesBarOnSwipe = YES 并尝试在 webView 中滑动时显示导航栏已隐藏,但当我尝试滑动以将其取回时,它将永远不会再次出现.p>
我的 ViewController 正在监听滑动事件:
[self.navigationController.barHideOnSwipeGestureRecognizer addTarget:self action:@selector(swipe:)]?但事实上,在导航栏因为 Swipe 而隐藏之后,这个选择器就再也不会被调用了.有人实现了 hidesBarOnSwipe 吗?它是一个已知的错误还是按照设计它隐藏后不会显示导航栏.
之前:
之后:
我的 UIWebView 也有同样的问题,通过将 WebView 的约束更新为相对于超级视图而不是布局指南:
When i set navigationController.hidesBarOnSwipe = YES and try swiping in the webView shown the navigation bar is hidden, but it will never show up again, when i try swiping to get it back.
My ViewController is listening to the swipe event :
[self.navigationController.barHideOnSwipeGestureRecognizer addTarget:self action:@selector(swipe:)]?
But this selector is in fact never called again after the navigation bar is hidden because of the Swipe. Anyone implemented hidesBarOnSwipe? Is it a known bug or is it as designed that it won't show the navigation bar after hiding it.
Before:
After:
I have the same problem with my UIWebView, It's fixed by updating the constrains of my WebView to be relative to the superview not layout guide:
这篇关于设置 navigationController.hidesBarsOnSwipe = YES 不再显示我的导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:设置 navigationController.hidesBarsOnSwipe = YES 不再显示我的导航栏
基础教程推荐
- UIImage 在开始时不适合 UIScrollView 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- Android Volley - 如何动画图像加载? 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
