iOS 画一个扇形不是从顶点

CAShapeLayer *layer = [[CAShapeLayeralloc]init];

    UIBezierPath *originPath = [UIBezierPathbezierPath];

    //起始中心点改一下

    [originPath moveToPoint:CGPointMake(200,200)];

    //顺和逆交叉的相互抵消

    [originPath addArcWithCenter:CGPointMake(200,200)radius:40startAngle:M_PI_2endAngle:M_PIclockwise:NO];

    [originPath addArcWithCenter:CGPointMake(200,200)radius:10startAngle:M_PIendAngle:M_PI_2clockwise:YES];

    [originPath closePath];

    layer.fillColor = [UIColorredColor].CGColor;//填充颜色

    

    layer.path = originPath.CGPath;

    [self.view.layeraddSublayer:layer];

iOS 画一个扇形不是从顶点

iOS 画一个扇形不是从顶点

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-05-23
相关资源
相似解决方案