ios - 滑动删除不适用于 TableVIewCell?

标签 ios objective-c tableview tableviewcell

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

self.frostedViewController.panGestureEnabled=NO;

但仍然面临同样的问题。

REFrostedViewController UIViewController 类的扩展

我的问题是

有没有办法禁用父类(super class)手势?

最佳答案

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

在 View Controller 中实现以下类别。它应该可以解决问题。

@interface UIView (CellSwipeAdditions)

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

@end

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

关于ios - 滑动删除不适用于 TableVIewCell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44798332/

相关文章:

json - 如何将 TableView 中的选定行(JSON)发送到另一个 View Controller ?

ios - TableView 重新加载过早

ios - 使用选择器 'touchesBegan:withEvent:' 的重写方法具有不兼容的类型 '(NSSet, UIEvent) -> ()'

ios - SCNAction 回调仅在设备上调用一次并在模拟器上正确调用

ios - GTM OAuth不下载刷新 token -iOS

iphone - 并加载 NIB/XIB 文件?

ios - 如何在没有关联的 UI 元素的情况下在 iOS 中创建一个 segue

为 UIScrollView 获取数据时 iOS 应用程序在 iPad 上崩溃

ios - 通过手势拉动显示 View 的隐藏部分

swift - Collection View 中的图像