2
votes

I have a scrollViewWith size width=320x10 and height=460. I add 10 images of size width=320 and height=460 in scrollview with paging enabled. Now I can scroll the from 1st image to 10th image by scrolling.

when scrollView show, it is always showed from the 1st page. I want to show initially any random page of the scrollView, such that i can scroll previous page and next page from initially. How can i do that?

1

1 Answers

7
votes
[scrollView setContentOffset: CGPointMake(0, y) animated: YES];

You should just need to set the y variable to the point where you would like to scroll to. For example:

[scrollView setContentOffset: CGPointMake(0, 920) animated: YES];

Should scroll to your 3rd image.