美文网首页iOS学习笔记
关于scrollView手势冲突的问题

关于scrollView手势冲突的问题

作者: 瞪凳 | 来源:发表于2017-06-19 10:48 被阅读34次

    //重写手势方法
    -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
    shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer
    *)otherGestureRecognizer
    {
    if ([otherGestureRecognizer.view
    isKindOfClass:NSClassFromString(@"UILayoutContainerView")])
    {
    if (otherGestureRecognizer.state == UIGestureRecognizerStateBegan && self.contentOffset.x == 0)
    {
    return YES;
    }
    }
    return NO;
    }

    相关文章

      网友评论

        本文标题:关于scrollView手势冲突的问题

        本文链接:https://www.haomeiwen.com/subject/jirgqxtx.html