How to get text in a CATextLayer to be clear

前端 未结 7 1824
不思量自难忘°
不思量自难忘° 2021-01-29 18:19

I\'ve made a CALayer with an added CATextLayer and the text comes out blurry. In the docs, they talk about \"sub-pixel antialiasing\", but that doesn\

7条回答
  •  走了就别回头了
    2021-01-29 19:13

    If you came searching here for a similar issue for a CATextLayer in OSX, after much wall head banging, I got the sharp clear text by doing:

    text_layer.contentsScale = self.window!.backingScaleFactor
    

    (I also set the views background layer contentsScale to be the same).

提交回复
热议问题