Gran rendimiento de desplazamiento de UIImage

I have a big UIimage (2000x2000). Image drawed every time on app start, and copied to CALayer. On Current time i put UIScrollView on main view, and make CALayer with drawn image. Scrolling on small zoom looks fine. But on min zooming , when whole image visible, image scroll slowed, it becomes not quick responsible on move touch.

So, the question. What can I do, to increase scrolling performance?

preguntado el 08 de noviembre de 11 a las 18:11

1 Respuestas

The approach I would take is to use a lower resolution version of your image at lower zoom levels (lower = zoomed out).

Primera vista esta publicación for resizing UIImages.

Responde a la scrollViewDidEndZooming:withView:atScale: method in UIScrollViewDelegate, and switch the images when a certain zoom level is reached. This will take some trial and error to find the correct balance. You may even want to render your image at several different resolutions. Be sure to generate the different sized UIImages in advance so there is no delay while zooming.

contestado el 23 de mayo de 17 a las 13:05

Tnx it's resolved slow scroll problem. Unfortunately image resize affect to image quality. - Tirex

The idea is to swap in the full resolution image once you zoom in past a threshold - you shouldn't actually notice any difference in image quality. I would be glad to take a look at the code if you want to post it. - Jacob Jennings

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.