Posted By

rabc on 09/14/11


Tagged

page UIScrollView uipagecontroll


Versions (?)

Set UIPageControll scroll view current page


 / Published in: Objective C
 

  1. - (void)scrollViewDidScroll:(UIScrollView *)_scrollView
  2. {
  3. CGFloat pageWidth = _scrollView.frame.size.width;
  4.  
  5. int page = floor((_scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
  6.  
  7. self.pageControl.currentPage = page;
  8. }

Report this snippet  

You need to login to post a comment.