0

我将MARKRangeSlider添加到 UITableViewCell 并按预期工作。拖动手柄时,表格视图控制器也弹出到前一个视图控制器。我怎样才能避免或阻止弹出的动作?

我通过添加委托尝试了以下代码,但未能达到结果。

 - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
         // CGPoint velocity = [panGestureRecognizer  velocityInView:panGestureRecognizer.view];
         // return fabs(velocity.y) > fabs(velocity.x);
        CGPoint translation = [(UIPanGestureRecognizer *)gestureRecognizer translationInView:gestureRecognizer.view.superview];
        // if you want an NSString
        NSLog(@"gestureRecognizer-superview %@", NSStringFromClass([gestureRecognizer.view.superview class]) );
        return fabs(translation.x) > fabs(translation.y);
    }


- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
    if (otherGestureRecognizer == leftPanRecognizer) {
        return YES;
    }
    if (otherGestureRecognizer == rightPanRecognizer) {
        return YES;
    }
    return NO;
}

它的间歇性问题。请告诉我如何处理它?

提前致谢

4

1 回答 1

0

我找到了解决方案,

In UITableViewControlleror UIViewControllerwhich has UITableViewto disable interactivePopGestureRecognizer in viewDidAppearand in the same Controller 开发人员必须在. 希望能帮助到你。 interactivePopGestureRecognizerviewWillDisAppear

于 2017-11-24T05:18:03.150 回答