0

I want to make a carousel which only covers part of the page. I also want it to start over from the beginning when it reaches the end.

dar512
  • 862
  • 8
  • 18
  • If you haven't seen this, this may be of some help: https://www.cocoacontrols.com/controls/icarousel – rymagno Aug 01 '14 at 20:28

1 Answers1

3

It is relatively easy. You just need to set content offset back to the beginning when you reach the end of the content. It will be transparent for the user and look like endless scroll view.

How to

  1. Let's say you have a scroll view with fixed content width.
  2. You set the content offset to somewhere in the middle (starting position).
  3. You have to check in scrollViewDidScroll: method if you should adjust the content offset to mimic endless scrolling.

Look into this question for implementation details:

how can i make uiscrollview infinite in ios?

Community
  • 1
  • 1
Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143