0

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Tirex
  • 23
  • 5

1 Answers1

1

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

First, see this post for resizing UIImages.

Respond to the 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.

Community
  • 1
  • 1
Jacob Jennings
  • 2,796
  • 1
  • 24
  • 26
  • Tnx it's resolved slow scroll problem. Unfortunately image resize affect to image quality. – Tirex Nov 11 '11 at 03:49
  • 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 Nov 11 '11 at 18:08