我有一个 UIView,它覆盖了 UITableView 的所有内容。 UIView 使用手势识别器来控制表格显示的内容。 我仍然需要垂直 UITableView 滚动和行点击。 如何将这些从手势识别器传递到表格?
最佳答案
如果您需要知道单元格的索引路径:
- (void)handleSwipeFrom:(UIGestureRecognizer *)recognizer {
CGPoint swipeLocation = [recognizer locationInView:self.tableView];
NSIndexPath *swipedIndexPath = [self.tableView indexPathForRowAtPoint:swipeLocation];
UITableViewCell *swipedCell = [self.tableView cellForRowAtIndexPath:swipedIndexPath];
}
这个问题之前已在 UIGestureRecognizer and UITableViewCell issue 中得到解答。 .
关于uitableview - 手势识别器和 TableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4454920/