我将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;
}
它的间歇性问题。请告诉我如何处理它?
提前致谢