我用过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/