doucumet说CAShapLayer是反锯齿的,为什么会得到这个结果。 我也在drawRect方法中用CGContext绘制一个圆圈,它非常完美。为什么cashapelayer的圆形路径不那么圆?
UIBezierPath *path = [UIBezierPath bezierPath];
[path appendPath:[UIBezierPath bezierPathWithOvalInRect:CGRectMake(150, 300, 136, 136)]];
self.circleLayer = [CAShapeLayer layer];
self.circleLayer.path = path.CGPath;
self.circleLayer.frame = self.bounds;
self.circleLayer.fillColor = [[UIColor whiteColor] colorWithAlphaComponent:0.6].CGColor;
[self.layer addSublayer:self.circleLayer];
你问我们如何关闭抗锯齿?或者,你的Core Graphics转换也在进行反锯齿,你只是想知道为什么这两者有所不同? – Rob
顺便说一句,我发现,如果你使用'UIBezierPath'方法'addArcWithCenter'具有非整数半径(例如150.2 vs 150),'CAShapeLayer'的反锯齿工件不会分散注意力。 – Rob