views:

28

answers:

1

Hey

Just wondering what the best way to find out what page you're on in a paged scroll view.

At the moment I have this:

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
  float page = scrollView.contentSize.width / scrollView.contentOffset.x;
}

is this the only way? Or am I missing some simple scrollView.page property or something?

... * goes to check * :p

A: 

Page is not really a code concept in a scrollview. The concept of a page in iOS is just a snapping between different sections of your scrollview. If you use a UIPageControl then the notion, and retrieval of a page is very easy, otherwise, your way is the way to go to determine the virtual "page"

coneybeare
ok brilliant. :) Thank you :)
Thomas Clayson