public Wheel(CGPoint center, nfloat outerRadius, nfloat innerRadius, CGColor background) { var discPath = new UIBezierPath(); discPath.AddArc(center, outerRadius, 0, (nfloat)FullCircle, true); var cutOutPath = new UIBezierPath(); cutOutPath.AddArc(center, innerRadius, 0, (nfloat)FullCircle, true); discPath.AppendPath(cutOutPath.BezierPathByReversingPath()); Path = discPath.CGPath; FillColor = background; }
protected CALayer CreateWheelLayer(CGColor background) { var wheel = new CAShapeLayer(); var discPath = new UIBezierPath(); discPath.AddArc(Center, Radius, 0, (nfloat)FullCircle, true); var cutOutPath = new UIBezierPath(); cutOutPath.AddArc(Center, SmallRadius, 0, (nfloat)FullCircle, true); discPath.AppendPath(cutOutPath.BezierPathByReversingPath()); wheel.Path = discPath.CGPath; wheel.FillColor = background; return(wheel); }