ios - ECSlidingViewController 禁用滑动以在 UITableView 中删除

标签 ios objective-c uitableview ecslidingviewcontroller

<分区>

我正在使用此源代码添加类似于 Facebook 应用程序的滑动菜单:

Git Hub 项目 ECSlidingViewController:https://github.com/edgecase/ECSlidingViewController

这是我的自定义 UINavigation Controller 的代码:

@implementation NavViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    if (![self.slidingViewController.underLeftViewController isKindOfClass:[ZAPMenuViewController class]])
    {
        self.slidingViewController.underLeftViewController  = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
    }

    [self.view addGestureRecognizer:self.slidingViewController.panGesture];
}

但是,我有一个 UITableView,我需要能够滑动才能删除。有没有一种方法可以在向左滑动时禁用 panGesture,但保留 panGesture 以向右滑动并显示菜单?

最佳答案

另请查看有关 ECSlidingViewController 的 wiki 的一些答案其中包括允许同时识别手势。

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer
 *)otherGestureRecognizer {
     if ([otherGestureRecognizer.view isKindOfClass:[UIScrollView class]]) {
         return YES;
     } else {
         return NO;
     } }

关于ios - ECSlidingViewController 禁用滑动以在 UITableView 中删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18578832/

相关文章:

ios - 在 IBOutletCollection 中交换图像

arrays - Int 和字符串数组 : Update only Int value?

ios - 可以将 Storyboard中的导航右栏按钮与编码的按钮结合起来吗?

ios - 总是预防性地将 UI 更改包装到主线程中?

ios - 如何在 Swift 中将 #file、#line、#column、#funcion 传递给我的 ErrorLogger

objective-c - IOS 7 后台获取

ios - UITextVIew 在屏幕上不可见

iphone - 双击选择器多次触发

ios - 如何阻止 UILabel 在 UITableCellView 中截断 '...'

iphone - 如何调整 UITableView 的大小以自定义动态扩展 UITableViewCell