首页 > 代码库 > iOS开发页面滑动返回跟scrollView左右划冲突问题

iOS开发页面滑动返回跟scrollView左右划冲突问题

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{    // 首先判断otherGestureRecognizer是不是系统pop手势    if ([otherGestureRecognizer.view isKindOfClass:NSClassFromString(@"UILayoutContainerView")]) {        // 再判断系统手势的state是began还是fail,同时判断scrollView的位置是不是正好在最左边        if (otherGestureRecognizer.state == UIGestureRecognizerStateBegan && self.contentOffset.x == 0) {            return YES;        }    }        return NO;}

 

iOS开发页面滑动返回跟scrollView左右划冲突问题