5

我正在尝试在 iOS 中绘制四分之一圆。在 Mac OS 中,您似乎可以使用 appendBezierPathWithArcWithCenter 但这在 iOS 中似乎不起作用。

有谁知道如何在 iOS 中简单地绘制四分之一圆?

谢谢

4

1 回答 1

4

有两个 iOS 等价物,一个 forUIBezierPath和一个 for CGPath

UIBezierPath相等的

UIBezierPath *path = [UIBezierPath bezierPath];
[path addArcWithCenter:centerPoint
                radius:radius
            startAngle:startAngle
              endAngle:endAngle
             clockwise:YES];

CGPath相等的

CGMutablePathRef path = CGPathCreateMutable();
CGPathAddArc(path, NULL,
             centerPoint.x, centerPoint.y,
             radius,   
             startAngle,  
             endAngle,   
             NO); // clockwise
于 2013-09-09T09:53:39.513 回答