UIImage as CAShapeLayer contents

后端 未结 5 1928
遥遥无期
遥遥无期 2021-01-14 17:23

If I create a CAShapeLayer with just a background color it shows up, but if i set the content to an image, nothing shows.

CAShapeLayer* leftDot = [CAShapeLa         


        
5条回答
  •  既然无缘
    2021-01-14 17:36

    CAShapeLayer doesn't work that way. You would create a normal CALayer with the image as its content and then use the shape layer as the mask of that layer to achieve the effect you are after.

提交回复
热议问题