爲了您無限的UIScrollView,實現uiscrollviewdelegate和嘗試這個辦法:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)sender {
CGFloat pageWidth = scrollView.frame.size.width;
int currentPage = floor((scrollView.contentOffset.x - pageWidth/2)/pageWidth) + 1;
if (currentPage==0) {
[scrollView scrollRectToVisible:CGRectMake(scrollView.frame.size.width * [dayOfWeek count],0,scrollView.frame.size.width,scrollView.frame.size.height) animated:NO];
} else if (currentPage==([myCovers count]+1)) {
[scrollView scrollRectToVisible:CGRectMake(scrollView.frame.size.width,0,scrollView.frame.size.width,scrollView.frame.size.height) animated:NO];
}
[self adjustDataInScrollviewHere];
}
你的問題應該是更具體的。 – sosborn