- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
//停止滚动时调用一次
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
//不停地调用,此处四舍五入,可以保证滑动中间的时候数字再变
int index = roundf(scrollView.contentOffsetX/kScreenWidth);//四舍五入
NSString *title = [NSString stringWithFormat:@"%ld/%ld", index +1, self.images.count];
}
网友评论