设置navigationController.hidesBarsOnSwipe = YES从不再显示我的导航栏 [英] Setting navigationController.hidesBarsOnSwipe = YES never shows my navbar again

查看:592
本文介绍了设置navigationController.hidesBarsOnSwipe = YES从不再显示我的导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我设置 navigationController.hidesBarOnSwipe = YES 并尝试在显示的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.

我的ViewController正在收听滑动事件:

My ViewController is listening to the swipe event :

[self.navigationController.barHideOnSwipeGestureRecognizer addTarget:self action:@selector(swipe:)]?

但是由于滑动隐藏了导航栏后,实际上从未再次调用此选择器。任何人都实现了 hidesBarOnSwipe ?它是一个已知的bug还是设计成隐藏后不会显示导航栏。

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.

之前:

之后:

推荐答案

我的 UIWebView 存在同样的问题,通过更新约束来解决这个问题我的 WebView 相对于superview而不是布局指南:

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从不再显示我的导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆