开发者

How to clip a CAShapeLayer?

I have a CAShapeLayer that i add a CAGradientLayer to, but there is no clipping about the shape of the CAShapeL开发者_如何学JAVAayer.


From your question it sounds more like you want to use a shape layer as a mask for a gradient layer. Create your CAShapeLayer adding a path to it. Then create a CAGradientLayer and set it's mask property. Then add your gradient layer to the layer hierarchy in your view.

[gradientLayer setMask:shapeLayer];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜