[英]How to mask a CALayer with another CALayer which is transparent?
I only managed to do so If I set cornerRadius property to the layer I want to mask. 如果我将cornerRadius属性设置为要遮罩的图层,则只能这样做。
I am trying to achieve: 我正在努力实现:
[blueView.layer addSublayer:redLayer]
Now I would like to have only red border (redLayer) and middle would be blue (because blueView is blue). 现在我只想有红色边框(redLayer),中间是蓝色(因为blueView是蓝色)。 This blue part is size/shape of maskLayer (and is transparent so thats why I should see blue color).
这个蓝色部分是maskLayer的大小/形状(并且是透明的,所以这就是为什么我应该看到蓝色的原因)。
Am I on a right track here? 我在正确的轨道上吗?
maskLayer
必须设置一些颜色。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.