Alex Rivera | Logout

How to auto scroll UIScrollView using timer?

Asked 2010-09-12T09:58:14.483
20

I have a UIScrollView to show images. I need a timer to show the images one after another, after every 5 seconds. How to initiate UIScrollView event to move to the next image after 5 seconds using the timer?

Edit
Report

1 Answer

4

to get current value as w (x value) or h (y value) of content. This helps with manual/semi automatic scrolling with the current reference point in your content of your UIScollView.

CGFloat w = scroller.contentOffset.x;

or

CGFloat h = scroller.contentOffset.y;

then of course:

h += 100; // h-=100 for decrement
yourScrollView.contentOffset = CGPointMake(0, h);  
answered 2012-09-13T16:39:16.407

Your Answer