你的位置:首页 > 软件开发 > 操作系统 > iOS 当使用FD_FullscreenPopViewController的时候遇到scrollView右滑手势无法使用的解决

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

发布时间:2017-03-24 00:00:26
当我们在ViewController中有scrollView的时候, 可能会遇到右滑无法响应返回手势, 有以下解决办法: 自定义scrollView, 实现该scrollView的以下方法即可:@implementation GOfflineContentScrollVie ...

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

  自定义scrollView, 实现该scrollView的以下方法即可:

@implementation GOfflineContentScrollView

 

-(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;

}

 

@end


 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:iOS 当使用FD_FullscreenPopViewController的时候遇到scrollView右滑手势无法使用的解决

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。