如何关闭自动手势以返回带有导航控制器的视图? [英] How to turn off the automatic gesture to go back a view with a navigation controller?

查看:10
本文介绍了如何关闭自动手势以返回带有导航控制器的视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我注意到当用户在屏幕的最左侧(以任一方向)滑动时,我的所有视图都收到了返回(弹出视图)的手势(这是 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 本身的初始化中(因为委托似乎正在使用它).

Within the init of the NavigationController itself (as the delegate seems to be using that).

推荐答案

obj-c

self.navigationController.interactivePopGestureRecognizer.enabled = NO;

迅速

navigationController?.interactivePopGestureRecognizer?.isEnabled = false

这篇关于如何关闭自动手势以返回带有导航控制器的视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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