UITapGestureRecograiser不使用UiTableViewCell
我正在使用UITableViewCell上的UITapGestureRecognitizer进行双击 所以我在CellForRowAtIndexPath中以这种方式添加了这个手势UITapGestureRecograiser不使用UiTableViewCell,uitableview,uigesturerecognizer,uitapgesturerecognizer,Uitableview,Uigesturerecognizer,Uitapgesturerecognizer,我正在使用UITableViewCell上的UITapGestureRecognitizer进行双击 所以我在CellForRowAtIndexPath中以这种方式添加了这个手势 UITapGestureRecognizer *m_doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)]; m_doubleTap.numberOfTapsRequired
UITapGestureRecognizer *m_doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)];
m_doubleTap.numberOfTapsRequired = 2;
[tableCell addGestureRecognizer:rightSwipeGestureRecogniser];
[tableCell addGestureRecognizer:m_doubleTap];
但是
而不是得到,这叫做
- (void)tableView:(UITableView*)tableView未选择RowatineXpath:(NSIndexPath*)indexPath { }
m_doubleTap.cancelsTouchesInView = YES;
m_doubleTap.delaysTouchesBegan = YES;
现在它可以工作了,但是didSelectRowAtIndexPath函数变得非常慢
那么如何解决这个问题呢。试试设置
[cell setUserInteractionEnabled:是]代码>
希望这能解决你的问题
或者尝试实现以下方法并返回nil
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath