Xcode 4 中标签的字体抗锯齿
我正在 Xcode4 Interface Builder 中编辑 xib 文件,按钮看起来不错,但标签缺少抗锯齿功能。
当我创建一个新文件并添加标签时,它们看起来确实不错。 有什么想法吗?
这是屏幕截图(抱歉,还不能发布图像) https://i.sstatic.net/GlhHB .png
I am editing a xib file in Xcode4 Interface Builder, buttons look OK, but labels are missing anti-aliasing.
When I create a new file and add labels, they do look fine.
Any ideas?
Here is a screenshot (can't post images yet, sorry) https://i.sstatic.net/GlhHB.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您看到的并不是缺乏抗锯齿,而是缺乏子像素抗锯齿。请注意差异:
彩色边缘与 LCD 上的“子像素”对齐,以便照亮实心像素块,并且看起来仍然是正确的颜色。
这里的问题是,核心动画不会像不使用 CA 时那样自动执行子像素抗锯齿。简单的解决方案是禁用视图(或任何具有它的超级视图)上的 CA 层支持。否则,这个问题有一些更有用的解释和有关解决方法的信息。
What you're seeing isn't a lack of antialiasing, it's a lack of subpixel antialiasing. Note the difference:
The colored edges line up with the "subpixels" on your LCD, so that a solid block of pixels is illuminated and it still looks like the right color.
The problem here is that Core Animation doesn't do subpixel antialiasing as automatically as it does when you don't use CA. The simple solution is to disable the CA Layer backing on your view (or whatever superview has it). Otherwise, this question has some more useful explanation and info about workarounds.