3
我創建一個UIBezierPath
這樣的:繪製UIBezierPath時出錯。沒有當前點
UIBezierPath *path = [UIBezierPath bezierPath];
[path addLineToPoint:CGPointMake(200.0, 40.0)];
[path addLineToPoint:CGPointMake(160, 140)];
[path addLineToPoint:CGPointMake(40.0, 140)];
[path addLineToPoint:CGPointMake(0.0, 40.0)];
[path closePath];
的問題是,當我試着畫出我的UIBezierPath
,它不會出現,我得到一個錯誤:
<Error>: void CGPathCloseSubpath(CGMutablePathRef): no current point.
我圖紙代碼是非常基本的:
UIGraphicsBeginImageContext(self.view.bounds.size);
[[UIColor whiteColor] set];
[myPath stroke];
UIGraphicsEndImageContext();
我在做什麼錯?