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,半像素绘制。效果比什么驱除锯齿状还好
原文地址:https://www.cnblogs.com/liyang31tg/p/4118964.html