objective-ctimeruiscrollviewnstimeruipagecontrol

automatic UIScrollView with paging


I have a UIScrollView with paging enabled. However i want this scrollview to scroll right when a certain amount of time has passed. Is there a easy way to implement this or do i need to use a timer and programmatically scroll the scrollview?

Something like this website has in its header: http://denederlandsewateren.nl/ [notice the text "De Nederlandse Wateren" changes each x seconds]


Solution

  • Found this on stackoverflow

    [scrollView setContentOffset:CGPointMake(x, y) animated:YES];
    

    To do slideshows with UIScrollView, you arrange all images in the scroll view, set up a repeated timer, then -setContentOffset:animated: when the timer fires.