CAShapeLayer线描

时间:2013-05-21 11:13:19

标签: iphone uiview core-animation intersection cashapelayer

我使用(X,Y axis)从一个位置到另一个位置({1}}绘制超过5个自定义uiviews(如UITableView行)。

我的问题是,我想知道CAShapeLayer(我的案例中的行)当前所处的位置。CAShapeLayerCGIntersect是否有CALayer等等?我正在尝试使用核心动画而不是任何图表API来创建图形。

1 个答案:

答案 0 :(得分:1)

您可以检查形状图层是否与特定图层相交,方法是检查路径边界框与另一图层框架的交点。

BOOL doesIntersect = CGRectIntersectsRect(CGPathGetBoundingBox(path), layer.frame);