开发者

Font issue with layer backed NSTextView

开发者 https://www.devze.com 2023-02-06 03:39 出处:网络
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?

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:开发者_如何学PythonYES]`


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消