UIView drawRect 代碼:
- (void)drawRect:(CGRect)rect {
UIBezierPath *trackPath = [UIBezierPath bezierPath];
[trackPath addQuadCurveToPoint:CGPointMake(10, 30) controlPoint:CGPointMake(0, 0)];
[trackPath stroke];
}
但是沒有繪圖出現,怎麼辦?
在addQuadCurve之前加一個初始化點
[trackPath moveToPoint:somePoint];