如何关闭自动手势以使用导航控制器返回视图? [英] How to turn off the automatic gesture to go back a view with a navigation controller?
本文介绍了如何关闭自动手势以使用导航控制器返回视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我注意到当用户在屏幕的最左侧(在任一方向上)滑动时,我的所有视图都接收到返回(弹出视图)的手势(这是iOS7的新功能) )
So I'm noticing all of my views are receiving the gesture to go back (pop a view) when the user swipes on the very left side of the screen (in either orientation) (This is new with iOS7)
到目前为止,我一直尝试使用以下方式将其关闭:
I've tried so far with no avail to turn it off using:
[self.navigationItem setHidesBackButton:YES];
在NavigationController本身的init中(因为委托似乎正在使用它)。
Within the init of the NavigationController itself (as the delegate seems to be using that).
推荐答案
obj-c
obj-c
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
swift
swift
navigationController?.interactivePopGestureRecognizer?.isEnabled = false
这篇关于如何关闭自动手势以使用导航控制器返回视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文