Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Infinite UIScrollView

I would like to implement a timeline, much like one you can find in iMovie or Final Cut, which you can scroll in either direction. Scrolling to the left would go back in time ( months ) and scrolling to the right would go forward in time, creating a smooth continues path.

What would be the best way to implement this?

  • Do tricky things with UIScrollView
  • Subclass UIView and try to re-create inertial scrolling

A disadvantage of recreating the inertial scrolling is if Apple ever decides to change it that my app will feel weird. I personally do not like it when an app does not feel system integrated, this includes games like tower madness where they made their own scrollview which works really bad and feels wrong.

like image 585
Antwan van Houdt Avatar asked Nov 07 '11 15:11

Antwan van Houdt


2 Answers

Apple has and example project featuring infinite scrolling it's called StreetScroller, the description says:

Demonstrates how a UIScrollView subclass can scroll infinitely in the horizontal direction.

I hope this helps you.

like image 72
3lvis Avatar answered Nov 10 '22 21:11

3lvis


StreetScroller can only support no paging mode. I wrote a class based on the StreetScroller and support paging & no paging at the same time. https://github.com/hellohalo/InfiniteScrollView

like image 35
user1117118 Avatar answered Nov 10 '22 20:11

user1117118