2016-09-16 4 views

Antwort

0

einen Pfad initialisieren.

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]; 

Versuchen Sie den obigen Code. Es ist nicht der getestete Code, ich bin nicht auf meinem System. Durch Anpassen des Kontrollpunkts können Sie den Radius des Bogens vergrößern.

Verwandte Themen