gpt4 book ai didi

ios - Xamarin iOS : Why there is a line from the center to arc of the circle

转载 作者:行者123 更新时间:2023-11-29 00:29:21 25 4
gpt4 key购买 nike

这是我画圆的代码,但不知何故,它有一条从圆心到圆边的线。我没有向其中添加一行,只有 move to 和 drawArc。

var geometry = Geometry.Instance;
var path = new UIBezierPath();
path.MoveTo(new CGPoint((nfloat)centerPiece.Center.X, (nfloat)centerPiece.Center.Y));
path.AddArc(new CGPoint((nfloat)centerPiece.Center.X, (nfloat)centerPiece.Center.Y), centerPiece.Radius, 0.0f, (float)Math.PI * 2, true);
context.SetLineWidth(centerPiece.BorderWidth);
context.SetStrokeColor(GetBorderPaint(centerPiece));

context.AddPath(path.CGPath);
context.DrawPath(CGPathDrawingMode.Stroke);

enter image description here

最佳答案

您可以使用以下方法创建您的 UIBezierPath:

(UIBezierPath *)createArcPath
{
UIBezierPath *aPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake((nfloat)centerPiece.Center.X, (nfloat)centerPiece.Center.X)
radius:(nfloat)centerPiece.Radius
startAngle:0
endAngle:DEGREES_TO_RADIANS(360)
clockwise:YES];
return aPath;
}

这可能是一个有用的 link还有!

关于ios - Xamarin iOS : Why there is a line from the center to arc of the circle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42284939/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com