animating the length of circular arrow mask in Core Animation

前端 未结 3 1181
天涯浪人
天涯浪人 2021-02-03 15:53

I\'ve created a circular animation using CAShapeLayer and masking. Here is my code:

- (void) maskAnimation{


    animationCompletionBlock theBlock;
    imageVie         


        
3条回答
  •  佛祖请我去吃肉
    2021-02-03 16:21

    Unfortunately, there are no options in path drawing to have a pointed line cap like the one you describe (options are available using CAShapeLayer's lineCap property, just not the one you need).

    You will have to draw the path boundary yourself and fill it, instead of relying on the width of the stroke. This means 3 lines and 2 arcs, which should be manageable, although not as straightforward as what you tried to do.

提交回复
热议问题