Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone UIScrollView Continuous Circular Scrolling

I have found similar questions here but none of them are answered. So please help me..I have a UIScrollView with five UIImageView as contents. No paging is there for the scroll view. I need to display the images in a continuous manner and allow the user to scroll infinitely without any jerk in a circular manner. So when the user scrolls to the right, after the last image, the first image should come and the scrolling should continue in the natural way. Similarly if the user scrolls left, after the first image, the fifth image should appear. I used didEndDeceleration but it will apply a sudden break to the scrolling giving a distortion to the user experience. Also, surprisingly, it is not called at the end of the scroll every time. I am now trying to override the setContentOffset of the UIScrollView by subclassing it. The result was better than didEndDeceleration but the sudden break is still there. Please help me..

Thanks in advance.

like image 983
DroidHeaven Avatar asked May 18 '26 23:05

DroidHeaven


1 Answers

Apple's Street Scroller demo from their UIScrollView presentation at WWDC 2011 should give you enough info to get this done. I also recommend watching the video. Has a lot of good stuff.

like image 180
Ross Kimes Avatar answered May 20 '26 13:05

Ross Kimes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!