Pixelated text in UILabel within UIScrollView, both with transparent background

别等时光非礼了梦想. 提交于 2019-12-12 00:51:15

问题


I have a weird issue:

I have a UIScrollView whose background is transparent. Inside of it there are a few UILabels also with a transparent background and with a custom font.

When the scrollview is first displayed everything looks sharp and good but as soon as I start panning the scroll view, the text of the labels gets extremely pixelated.

This does not happen if i set an opaque background to the labels.

Do you have any idea what might be causing this?


回答1:


This sounds like you may be adding several layers of the identical UILabel on top of the others on scroll. Place a debug breakpoint on the code that adds it to your content, and ensure it is only being called once.

The "pixelation" could be caused by the overlapping of anti-aliasing pixels.



来源:https://stackoverflow.com/questions/11383205/pixelated-text-in-uilabel-within-uiscrollview-both-with-transparent-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!