相关疑难解决方法(0)

UITongPress上的UILongPressGestureRecognizer - 双重调用

我在一个单元格中使用UILongPressGestureRecognizer.我需要的是:当用户点击一个单元格1.0秒时,调用一个视图控制器.如果用户点击该单元格,则另一个VC.

我可以通过使用UILongPressGestureRecognizer来实现这一点.但问题是调用viewController两次.

码:

if (indexPath.section == 0 && indexPath.row == 1){
    UILongPressGestureRecognizer *longPressTap = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(memberListWithSearchOptions)];

    longPressTap.minimumPressDuration = 1.0;

    [cell addGestureRecognizer:longPressTap];
    [longPressTap release];
}
Run Code Online (Sandbox Code Playgroud)

我认为我需要的是,在识别出LongPress后,禁用识别器,直到tableView再次出现在屏幕上.

我怎样才能做到这一点?

谢谢,

RL

uitableview uigesturerecognizer ios

4
推荐指数
1
解决办法
3329
查看次数

标签 统计

ios ×1

uigesturerecognizer ×1

uitableview ×1