Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think this is what you'll want to do.</p> <p>Put some number (z) of UIImageView's as the background. Extract these into a separate control so you only have to add one "background view". Say you want to scroll up, down, left, and right. You also want to zoom out beyond the content size. So, you need x amount of images to cover your scroll views width, and s images to buffer the width on a zoom. (y to cover height and t to buffer height, so z = x + r + y + t)</p> <p>Side note: When I say buffer the width, I mean put the images at an origin that lies outside the bounds of the content size. That way when zooming out past the content bounds, you will see these images, and not "around" the background.</p> <p>When you scroll to the right a sufficient distance (based on your image size related to the scroll view bounds, or what is the visible frame), then move the now none visible image view to the right side of the right-most image view. Do the analogous thing for scrolling left, up, and down. You might need to add/remove image views when zooming occurs... or just use the maximum number of image views needed at all times.</p> <p>The point is to increase performance, so ideally the number of image views your working with is small. The number increases proportionally to sizeof(scrollview.bounds)/sizeof(image). sizeof meaning frame size, not bytes, naturally.</p> <p>EDIT: To help illustrate this concept, we might make the following analogy. The scrollview is a lens looking in at part of a tiled floor, the content background of the scrollview is the tiled floor. However, we are only using a sufficient amount of tiles based on the lens. As the lens moves, we move non-visible tiles into areas where the lens will move to. As the lens zooms out, we add tiles (if removing them as we zoom in). I hope that helps clear things up instead of make it more confusing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload