UIImage as CAShapeLayer contents

后端 未结 5 1833
遥遥无期
遥遥无期 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:33

    You can get the image to appear by setting the fillColor rather than the contents:

    layer.fillColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image"]].CGColor;
    

提交回复
热议问题