页面控制指示器不跟随滚动视图。我都尝试了:-没有任何效果..我做错了什么?
-(void) scrollViewDidScroll:(UIScrollView *)scrollView{
CGFloat pageWidth = self.scroller.frame.size.width;
int page = floor((self.scroller.contentOffset.x - pageWidth/2)/ pageWidth)+1;
self.pageControl.currentPage=page;
}
-(void) scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
int page = scrollView.contentOffset.x / scrollView.frame.size.width;
self.pageControl.currentPage = page;
}