【发布时间】:2012-04-15 13:35:09
【问题描述】:
我想知道是否有可能让 CAShapeLayer 笔触不止一条路径,因为实际上它只需要一条路径作为参数,例如:
CAShapeLayer* myLayer=[CAShapeLayer layer];
myLayer.path=myBezierPath
但是如果我想在该层上绘制多个路径怎么办?
【问题讨论】:
-
好吧,我自己发现了。可以做到:好的,我自己发现了。可以执行以下操作: CGMutablePathRef combinedPath= CGPathCreateMutableCopy(path.CGPath); CGPathAddPath(combinedPath, NULL, path2.CGPath); CGPathAddPath(combinedPath, NULL, path3.CGPath); CGPathAddPath(combinedPath, NULL, path4.CGPath); myLayer.path=combinedPath;
-
您最好在上面发表您的评论作为答案。 :)
-
iJatrat - 很好的答案,但您需要发布并接受它作为答案
标签: ios cocoa-touch cocoa core-animation core-graphics