2

How is it possible to implement infinite scrolling with UIScrollView when calling setContentOffset: on UIScrollView halts the scrolling? Every time i reach end of my offset, I call this to make go back to the beginning of my offset but calling this causes the scrolling to stop.

Thanks,

0xSina
  • 20,973
  • 34
  • 136
  • 253

2 Answers2

4

Check the StreetScroller sample and the Advanced Scroll View Techniques from WWDC2011.

Marcelo Alves
  • 1,856
  • 11
  • 12
  • Great video, thanks for the link. If you have any follow-ups that show how to do infinite scrolling in both x and y I'd be extremely grateful :) – jowie Mar 27 '12 at 12:17
-1

setContentOffset: on it's own won't stop the scrolling. I suspect what's stopping the scroll is something like reaching the end of the contentSize. Try resetting the offset before you get to the end of the content size.

How you do this depends on your implementation. For example, simply increasing contentSize by {50, 50} may solve the problem.

mohsenr
  • 7,235
  • 3
  • 28
  • 28