试着理解为什么我用CGContextShowTextAtPoint获得低质量的绘图?见附图:

字母"W"是在CALayer上使用CGContextShowTextAtPoint绘制的,看起来非常像素化.它旁边的按钮是一个标准按钮,按预期看起来很高.我想让文字绘图成为高分辨率.

我正在使用autolayout,我有一个RoundView类(UIButton的子视图),其drawRect方法是:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat lineWidth = 0.0;
CGContextSetLineWidth(context, lineWidth);
CGContextSetFillColorWithColor(context, _currentBackgroundColor.CGColor);
CGContextAddEllipseInRect(context, self.bounds);
CGContextFillPath(context);
}
Run Code Online (Sandbox Code Playgroud)
然后我将它添加到self(一个UIView),使用autolayout设置其宽度和高度.一切看起来都很棒.但是当我改变它的大小限制(有更大的视图),并调用
[self layoutIfNeeded];
Run Code Online (Sandbox Code Playgroud)
在动画块中,圆形像素看起来更大更难看.
我这样做的方法是否正确?
