0

UITableViewCell에서 doubleTap에 대해 UITapGestureRecognizer로 작업하고 있습니다.UITapGestureRecogniser가 UiTableViewCell과 함께 작동하지 않습니다.

그래서 CellForRowAtIndexPath에서 이러한 방식으로 제스처를 추가했습니다.

UITapGestureRecognizer *m_doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)]; 
    m_doubleTap.numberOfTapsRequired = 2; 


    [tableCell addGestureRecognizer:rightSwipeGestureRecogniser]; 
    [tableCell addGestureRecognizer:m_doubleTap]; 

그러나

- (void)doubleTap:(UITapGestureRecognizer *)gestureRecogniser 
{ 
} 

대신이라고 점점되지

  • (무효)있는 tableView : (jQuery과 *)있는 tableView didSelectRowAtIndexPath : (NSIndexPath *) indexPath { }

ried this ..

m_doubleTap.cancelsTouchesInView = YES; 
    m_doubleTap.delaysTouchesBegan = YES; 

이제는 작동하지만 didSelectRowAtIndexPath 기능이 매우 느려집니다.

그래서이 문제를 해결하는 방법.

답변

1

한번에 설정

[cell setUserInteractionEnabled:YES];

희망이 당신의 문제를 해결한다.

또는 다음과 같은 방법을 구현하는 시도하고 돌아 nil

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 
관련 문제