How to Get the reverse path of a UIBezierPath

后端 未结 4 1426
花落未央
花落未央 2021-02-07 14:56
self.myPath=[UIBezierPath bezierPathWithArcCenter:center 
                                           radius:200 
                                       startAngle:0 
            


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-07 15:29

    I have two solution for you.

    1. Draw this path on a CALayer. And use that CALayer as a mask layer for you actual CALayer.

    2. Draw a rectangle with the sizes of you frame before adding arc.

      UIBezierPath *path = [UIBezierPath bezierPathWithRect:view.frame];
      [path addArcWithCenter:center 
                      radius:200 
                  startAngle:0 
                    endAngle:2*M_PI 
                   clockwise:YES];
      

    I would use second solution. :)

提交回复
热议问题