0
votes

I have a scrollView and inside this scroll view I have 4 images. It's in paging enabled. But I want to do an IBAction that scroll these images random. How can I do?

2

2 Answers

0
votes
#define numPages 4

CGRect frame = scrollView.frame;
frame.origin.x = frame.size.width * (arc4random() % (numPages - 1));
frame.origin.y = 0;
[scrollView scrollRectToVisible:frame animated:YES];
0
votes

it may be useful to you. every time change the contentoffset

[scrollView contentOffset:CGSizeMake(totalscrollviewwidth,480];

And find this link also