1

Possible Duplicate:
UIScrollView. Any thoughts on implementing “infinite” scroll/zoom?

I notice that in the stocks application, the small graph wraps around, eg: when you get to the end of the scroll view and swipe right again, you go back to the beginning. Before I go ahead and code this myself is there an easy way to do this in the SDK? I can't find any properties or methods that would enable that?

I have a paged UIScrollView that scrolls horizontally, pretty much exactly like the stocks application one does.

Community
  • 1
  • 1
rustyshelf
  • 44,963
  • 37
  • 98
  • 104
  • I want to know this too. They do it in iWork on the iPad... Is there a way for me to add another bounty :P? – Grant Paul Jun 23 '10 at 22:00

1 Answers1

6

I don't think there's a property to do this. I've faked it by adding an extra page on each end, so with for a 5 page UIScrollView you'd set the contentSize for 7 pages and load them like this:

5 1 2 3 4 5 1

Then in scrollViewDidEndDecelerating:, check if you're at either end and if so call scrollRectToVisible:animated: on your UIScrollView to jump it to the "real" page 1 or 5 position (without animation).

Cheddar
  • 974
  • 5
  • 9
  • Hi John! I try that, and it woks fine. What about if want to show 3 images at the time and have the same effect?? Can you help me?? – Frade Dec 14 '11 at 11:37