I ve got a UIScrollView including several table, and a UIPageControlding Line of which page theuser is present viewing. 它进行精彩的UNTIL,即开始在表格上浏览,届时UIPageControl调整,并(正确)说,我们正处于第一页。
我的守则是:
- (void)scrollViewDidScroll:(UIScrollView *)_scrollView {
if (pageControlIsChangingPage) {
return;
}
/*
* We switch page at 50% across
*/
CGFloat pageWidth = _scrollView.frame.size.width;
int page = floor((_scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
pageControl.currentPage = page;
}
而且:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)_scrollView {
pageControlIsChangingPage = NO;
}
不知道究竟是什么原因造成这种情况? 倾斜: