GLTapLabel里面的UITableView

我正在使用GLTapLabel在我的UITableView显示我的文字。 它会有一些链接,我可以点击作为GLTapLabels ,但是当我点击这些链接tableView:didSelectRowAtIndexPath:触发。 那么如何检测这些链接中的点击操作?

实现tableView:willSelectRowAtIndexPath:并返回任何你不想被选中的行的nil

返回值确认或更改所选行的索引path对象。 如果您想要select另一个单元格,则返回indexPath之外的一个NSIndexPath对象。 如果不想select行,则返回nil。

例如,为了防止第一部分的select:

 - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { return nil; } return indexPath; } 

您也可以尝试在GLTapLabel上设置exclusiveTouch或覆盖其hitTest:withEvent:如为什么UIView的exclusiveTouch属性没有被阻止? 。