隐藏导航栏时,UINavigationContoller interactivePopGestureRecognizer处于非活动状态 [英] UINavigationContoller interactivePopGestureRecognizer inactive when navigation bar is hidden
问题描述
我有一个嵌套在 UINavigationController
中的视图控制器。
I have a view controller which is nested within a UINavigationController
.
我已经实现了iOS 7 interactivePopGestureRecognizer使用户能够手势将VC从堆栈中弹出。
I have implemented the iOS 7 interactivePopGestureRecognizer to enable the user to gesture to pop a VC off the stack.
在VC中我有一个滚动视图,而用户不在滚动视图的顶部我隐藏所有chrome(导航栏和状态栏)将焦点放在内容上。
Within the VC i have a scrollview and whilst the user is not at the top of the scrollview I hide all the chrome (Navigation bar and status bar) to place focus on the content.
但是隐藏了导航栏,interactivePopGestureRecognizer无效。
However with the navigation bar hidden, the interactivePopGestureRecognizer is not working.
我已经尝试在它消失后启用并验证它不是零,但它仍然不起作用。
I have tried enabling it after it has disappeared and verified it is not nil, however it still doesn't work.
是有什么我想念的吗?
推荐答案
将你的UIViewController子类设置为gestureRecognizer的委托:
Set your UIViewController subclass as the gestureRecognizer's delegate:
self.navigationController.interactivePopGestureRecognizer.delegate = self;
就是这样!
这篇关于隐藏导航栏时,UINavigationContoller interactivePopGestureRecognizer处于非活动状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!