Rendering a huge grid in a Scrollview container without a CATiledLayer?

I am looking for any advice on how to have a fairly large scrollview (say 8192x8192), which is essentially a grid, and has subroutines of about 5-100 buttons placed in it.

In brute force mode, there is not enough memory since CALayer apparently allocates a bitmap for the size of the scrollview content (the memory problem is especially noticeable when using scaling)

Then I added a CATiledLayer to it, which fixed the memory problem, but there is a blurry effect on the grid since the tiles are generated asynchronously and are still not perfect in the sense that it uses a lot of memory for what is essentially a trivial draw "specifying some lines.

It seems that if I could somehow get control of my own grid through OpenGL for each frame and tell UIKit not to create a bitmap buffer for scrollview, that would be fine, but it would not be sure how possible or even the right approach would be?

On Android, I just took control of the whole drawing / scaling / panning, but does it seem like over-oversizing on iOS, which seems to offer most of this already?

+4
source share
1 answer

You should check out the WWDC 2009 102 video session: โ€œMastering iPhone Scrolling,โ€ along with Apple's sample ScrollViewSuite project. They explain how to make a tiled scroll view with different zoom levels, which sounds the way you need it.

+1
source

All Articles