UITableViewCell子视图在向左滑动时没有获得滑动手势回调

时间:2014-05-26 07:02:05

标签: ios uitableview uiswipegesturerecognizer

我在StackOverflow上看到了其他问题并完成了以下操作:

UISwipeGestureRecognizer *swipeGestureLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(viewDidSwipeLeft:)];
swipeGestureLeft.delegate = self;
[swipeGestureLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
[self.mainView addGestureRecognizer:swipeGestureLeft];

UISwipeGestureRecognizer *swipeGestureRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(viewDidSwipeRight:)];
swipeGestureRight.delegate = self;
[swipeGestureLeft setDirection:UISwipeGestureRecognizerDirectionRight];
[self.mainView addGestureRecognizer:swipeGestureRight];

我没有viewDidSwipeLeft:来电

我也在tableView类中添加了它..

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellEditingStyleNone;
}

0 个答案:

没有答案