-1
Comment dessiner une courbe comme indiqué dans l'image en utilisant UIBezierPath?Comment faire une courbe avec UIBezierPath?
Comment dessiner une courbe comme indiqué dans l'image en utilisant UIBezierPath?Comment faire une courbe avec UIBezierPath?
Initialiser un chemin.
UIBezierPath *aPath = [UIBezierPath bezierPath];
CGFloat xPos = 100.0;
CGFloat yPos = 50.0;
CGFloat width = 200;
CGFloat height = 200;
CGPoint controlPoint = CGPointMake(10.0, 10.0);
// Set the starting point of the shape.
[aPath moveToPoint:CGPointMake(xPos, yPos)];
[aPath moveToPoint:CGPointMake(xPos, width)];
// Draw the lines.
[aPath addLineToPoint:CGPointMake(width, height)];
//Add your arc here
[aPath addCurveToPoint:CGPointMake(xPos, height) controlPoint1:controlPoint controlPoint2:CGPointZero]
[aPath addLineToPoint:CGPointMake(xPos, yPos)];
//Close the Path
[aPath closePath];
Essayez le code ci-dessus. Ce n'est pas le code testé, je ne suis pas à mon système. En ajustant le point de contrôle, vous pouvez augmenter le rayon de l'arc.
Question intéressante. Avez-vous essayé quelque chose? – CivFan
@CivFan J'ai beaucoup essayé mais pas de succès. J'ai essayé d'utiliser la méthode d'arc du chemin d'UIBezier. – milanpanchal