比如当前的collectionViewA(蓝色), 还有一个collectionViewCellA(红色),collectionViewCellA(红色)里面有一个collectionViewB(绿色), collectionViewCellB(绿色)里面有两个collectionViewCellB1(白色)、collectionViewCe
比如当前的collectionViewA(蓝色), 还有一个collectionViewCellA(红色),collectionViewCellA(红色)里面有一个collectionViewB(绿色),
collectionViewCellB(绿色)里面有两个collectionViewCellB1(白色)、collectionViewCellB2(白色)
点击collectionViewCellA(红色) 弹出点击collectViewAcell
点击collectionViewB(绿色) 也弹出点击collectViewAcell
点击collectionViewCellB1(白色)、collectionViewCellB2(白色) 弹出点击collectViewBcell
- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event { CGPoint btnPointInA = [self.collectView convertPoint:point fromView:self]; if ([self.collectView pointInside:btnPointInA withEvent:event]) { for (UIView *subView in self.collectView.subviews) { CGPoint subViewPoint = [subView convertPoint:point fromView:self]; if ([subView pointInside:subViewPoint withEvent:event]) { return subView; } return self; } // 否则,返回默认处理 return [super hitTest:point withEvent:event]; }