阻止视图拖动到侧边菜单

时间:2016-04-26 18:51:53

标签: ios objective-c

我有侧面菜单控制器,您可以在其中访问所有控制器,侧控制器。出于某种原因,当我拖动我的一个视图(实际上是典型的视图控制器)从左到右触摸它时,它会拖动并显示侧面菜单控制器。请看一下:

enter image description here

如何防止这种行为?是否有任何可以提供帮助的UIView方法?

我试过了:

 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]){
    [self.navigationController.view removeGestureRecognizer:self.navigationController.interactivePopGestureRecognizer];
    }

但它不起作用,我想这是因为这不是导航控制器问题。

1 个答案:

答案 0 :(得分:2)

对于幻灯片菜单实现我通常使用framework(pod)

pod 'SWRevealViewController', '~> 2.3'

它可以包含所有方法gesture on/offtap on/off。 我希望你会喜欢这个!!

相关问题