Font issue with layer backed NSTextView

旧时模样 提交于 2020-01-02 19:32:41

问题


I have a small problem with the nstextview, when I send [textView setWantsLayer:YES], the font in the textView become blurred, anybody know why is it?

[[textView enclosingScrollView] setDrawsBackground:NO];
[textView setDrawsBackground:NO];
[textView setWantsLayer:YES]`

回答1:


The problem here is likely with aliasing the text because the background color is transparent, thus causing it to alias against a transparent background, which is going to look pretty bad.

Generally, I've found that I can [textView setWantsLayer: YES] as long as I also [textView setDrawsBackground: YES] and set a background color that is opaque.

Good luck.



来源:https://stackoverflow.com/questions/4779507/font-issue-with-layer-backed-nstextview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!