【UItableViewCell 添加UIPanGestureRecognizer 能够正常使用的关键代码】

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {

    if (gestureRecognizer == mPanGestureRecognizer) {

        UIScrollView *superview = (UIScrollView *) self.superview;

        CGPoint translation = [(UIPanGestureRecognizer *) gestureRecognizer translationInView:superview];

        

        // Make sure it is scrolling horizontally

        return ((fabs(translation.x) / fabs(translation.y) > 1) ? YES : NO && (superview.contentOffset.y == 0.0 && superview.contentOffset.x == 0.0));

    }

    returnNO;

}

  

posted @ 2013-04-09 15:46  码匠阿杰  阅读(619)  评论(0编辑  收藏  举报