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