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.youkuaiyun.com/rhljiayou/article/details/9919713