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 不再显示我的导航栏
基础教程推荐
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01
- 如何使用 YouTube API V3? 2022-01-01
- Android文本颜色不会改变颜色 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
