1.創建一個view繼承uiview
步驟:
-(void)drawRect:(CGRect)rect{
a.獲取上下文
CGContextRef context = UIGraphocsGetCurrentContext();
b.起點
CGContextMovetoPoint(context,0,0);
c.目標點
CGContextAddLintToPoint(context,x,y);
d.設置上下文屬性
CGContextSetLineWidth(context,20.0);
CGContextSetLineCap(context,KCGLineRound);
2繪製路徑
CGContextDrawPath(context.kCGLineCapRound);.
}\
http://blog.csdn.net/rhljiayou/article/details/9919713