我正在尝试在 iOS 中绘制四分之一圆。在 Mac OS 中,您似乎可以使用 appendBezierPathWithArcWithCenter 但这在 iOS 中似乎不起作用。
有谁知道如何在 iOS 中简单地绘制四分之一圆?
谢谢
我正在尝试在 iOS 中绘制四分之一圆。在 Mac OS 中,您似乎可以使用 appendBezierPathWithArcWithCenter 但这在 iOS 中似乎不起作用。
有谁知道如何在 iOS 中简单地绘制四分之一圆?
谢谢
有两个 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