Pregunta

Simple question: I have a CATextLayer. I want to make it bigger when I pinch it with a CAAnimation (any type you desire, prefer CABasicAnimation). How can I do this?

Note: can't use a simple CABasicAnimation with transform.scale as key, since if it is yes, resizes. but the text becomes terrible (not sharp at all). It's only an option if I can render the text while scaling. If this is possible, please help. Thanks!

¿Fue útil?

Solución

To make the CATextLayer appear sharper as it scales up, increase its contentsScale. Don't overdo it, since you are demanding four times as much memory for every doubling of the scale.

(If this is a CATextLayer that you are creating yourself, you should have been setting its contentsScale at least to the screen resolution all along. The system does not do this for you.)

You might also like to use a scroll view, since it automatically does pinch-zooming for you. See the section of my book on zooming with detail.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top