- I have a UIScrollView of size 320*460 and with content size 1024*1024.
- I can place 25 images of 256*256 in it with the 13th picture shown at the centre of the screen when it loades with bits of surrounding pictures around it.
- When i swipe to any side I want it to appear just like the mapView. With new images appearing and showing.
How can I do it?
Checkout the sample code called 'Tiling'. It might be what you're looking for.
It's very easy & somewhat tricky...
You don't need to define the specific size for the ScrollView.....
Generally we use to define ....as per the Examples of Apple
which is of no use...if you need the infinite height..
just set the height of the ScrollView dynamically as per the Objects added to the ScrollView....
No need to set the predefined height for this...take the dynamic height....
Hope this will surely work for you..
Good Luck :)
When scrolling stops, couldn't you just adjust the bounds so that you are now "re-centered" with your new offset?
Presumably you can't scroll more than so many pixels before your finger hits the edge of the screen, so you only need bounds that a few hundred pixels outside the original center.
Once you have a new center, adjust your bounds accordingly, retiling as necessary.