iOS 当使用FD_FullscreenPopViewController的时候遇到scrollView右滑手势没法使用的解决

   当咱们在ViewController中有scrollView的时候, 可能会遇到右滑没法响应返回手势, 有如下解决办法:spa

  自定义scrollView, 实现该scrollView的如下方法便可:3d

@implementation GOfflineContentScrollViewit

 

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizerio

{class

    // 首先判断otherGestureRecognizer是否是系统pop手势scroll

    if ([otherGestureRecognizer.view isKindOfClass:NSClassFromString(@"UILayoutContainerView")]) {方法

        // 再判断系统手势的statebegan仍是fail,同时判断scrollView的位置是否是正好在最左边im

        if (otherGestureRecognizer.state == UIGestureRecognizerStateBegan && self.contentOffset.x == 0) {margin

            return YES;view

        }

    }

    return NO;

}

 

@end

相关文章
相关标签/搜索