ios 绘图的时候line宽度最小为2的解决方案

 CGContextMoveToPoint(ctx, 4.5, (KCaladerViewOfHeadHight-1)+0.5);
    [[UIColor colorWithRed:61/255.0 green:122/255.0 blue:215/255.0 alpha:1] setStroke];
    CGContextSetLineWidth(ctx, 1.0);
    CGContextSetShouldAntialias(ctx, NO);
    CGContextAddLineToPoint(ctx, (self.frame.size.width-4)+0.5, (KCaladerViewOfHeadHight-1)+0.5);
    CGContextStrokePath(ctx);
//在原来的基础上加上0.5,半像素绘制。效果比什么驱除锯齿状还好

 

posted @ 2014-11-24 16:21  离子  阅读(190)  评论(0编辑  收藏  举报