【问题标题】:Swipe delete not working on TableVIewCell?滑动删除在 TableVIewCell 上不起作用?
【发布时间】:2017-12-01 13:45:01
【问题描述】:

我在我的项目中使用了REFrostedViewController 侧边菜单。 它使用 PanGesture 与TableViewCell 上的滑动手势冲突 我还尝试使用其属性禁用其 PangGusture

self.frostedViewController.panGestureEnabled=NO;

但仍然面临同样的问题。

REFrostedViewControllerUIViewController 类的扩展在哪里

我的问题是

是否有禁用超类手势?

【问题讨论】:

  • 我面临同样的问题:(
  • 尝试禁用forstedViewController.panGestureEnabled = false的属性

标签: ios objective-c tableview tableviewcell


【解决方案1】:

很可能 REFrostedViewController 侧边菜单会拦截并阻止手势。

在视图控制器中实现以下类别。它应该可以解决问题。

@interface UIView (CellSwipeAdditions)

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;

@end

@implementation UIView (CellSwipeAdditions)
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
    return YES;
}

【讨论】:

    猜你喜欢
    • 2011-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多