2016-09-16 44 views

回答

0

初始化路徑。

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

嘗試上面的代碼。這不是測試的代碼,我不在我的系統。通過調整控制點,可以增加弧的半徑。