iPhone: Infinitely looping content inside UIScrollView

Posted by Cuzog on Stack Overflow See other posts from Stack Overflow or by Cuzog
Published on 2010-06-10T22:14:22Z Indexed on 2010/06/10 22:22 UTC
Read the original article Hit count: 341

In my app, I'm designing a custom picker that allows the user to choose an item by scrolling horizontally and touching it. I need the buttons inside that view to loop around infinitely as the user scrolls in a certain direction. What would be the best way to tackle this feature while maintaining the inertial scrolling of UIScrollView when the content loops around out of the view?

From my research of others trying to attempt this, they have trouble maintaining the deceleration animation if the scroll position is programatically shifted mid-scroll after the user lifts their finger. How can I work around this limitation?

An example of an app that currently has this feature is Apple's MobileMe Gallery app. In the interface, after choosing a gallery, at the top, there is a horizontally scrollable photo picker that loops infinitely as it is dragged one direction.

Any advice is greatly appreciated.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch