阅读背景:

关于iOS中画直线无法显示的问题

来源:互联网 

今天修改软件UI时候需要画一条直线,先采用了一下的代码:

CGContextRef context =UIGraphicsGetCurrentContext();  
CGContextBeginPath(context);  
CGContextSetLineWidth(context, 2.0);  
CGContextSetStrokeColorWithColor(context, [UIColorwhiteColor].CGColor);   
CGContextSetLineDash(context, 0, lengths,2);  
CGContextMoveToPoint(context, 10.0, 20.0);  
CGContextAddLineToPoint(context, 310.0,20.0);  
CGContextStrokePath(context);  
CGContextClosePath(context);  CGContextRef 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: