How to get text in a CATextLayer to be clear

前端 未结 7 1840
不思量自难忘°
不思量自难忘° 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 18:56

    Swift

    Set the text layer to use the same scale as the screen.

    textLayer.contentsScale = UIScreen.main.scale
    

    Before:

    After:

提交回复
热议问题