字体问题与层支持NSTextView

字体问题与层支持NSTextView

本文介绍了字体问题与层支持NSTextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题与 nstextview ,当我发送 [textView setWantsLayer:YES] 在textView中变得模糊,任何人知道为什么是这样?

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]`


推荐答案

这里的问题很可能与文本混叠,因为背景颜色是透明的,因此导致它对透明背景进行别名,这将是非常糟糕的。

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.

,我发现我可以 [textView setWantsLayer:YES] 只要我也 [textView setDrawsBackground:YES] 并设置不透明的背景颜色。

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.

祝你好运。

这篇关于字体问题与层支持NSTextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 16:50