如何在UIScrollView中使用系统弹出手势?

时间:2015-05-23 03:21:05

标签: ios

我在UIScrollView中有UINavigationController,但我发现当我触摸scrollView时我无法使用系统的弹出手势,我应该如何解决冲突?

1 个答案:

答案 0 :(得分:1)

已修复,自定义左侧导航项会导致此问题,我添加了代码

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
            self.navigationController.interactivePopGestureRecognizer.delegate = nil;
        }

但在某些情况下仍然不起作用,应该像

一样进行修改
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
            self.navigationController.interactivePopGestureRecognizer.delegate = self;
        }
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return [gestureRecognizer isKindOfClass:UIScreenEdgePanGestureRecognizer.class];
}