Friday, 15 April 2011

iphone - How to autoscroll image by image? -


I have about 9 images on scrollview, I want to autocrossing the image by image (like the first image second and second Scroll to the other side .. that is the last one) I did something like this:

  timer = [NSTimer Scheduled timer with timer: .0 Target: Self Selector: @Selector (scrolling) userInfo: zero Repeats: No]; - (zero) scrolling {CGFloat currentOffset = scrollView.contentOffset.x; If (current offset & lt; 2236) {CGFloat newOffset = currentOffset + 172; [UIScrollView Start Permissions: Zero Reference: NULL]; [UIScrollView Set Animation Duration: 2.1]; [ScrollView setContentOffset: CGPointMake (New Offset, 0.0) Animated: Yes]; [Send UIScrollViewAnimation]; }   

But scroll it only once (from the first image to the other). what did I do wrong? Any ideas?

Set repeat in yes. This is the last parameter, besides, ensure that the interval is not 0. (Post code shows .0)

  timer = [NSTimer Scheduled timer with time interval: 3.0 targets: Self selector: @sillector (scrolling) userInfo: zero repetition: yes];    

No comments:

Post a Comment