问题
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