2019独角兽企业重金招聘Python工程师标准>>>
ScrollView常用代理方法:
#pragma mark - 滚动结束调用
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {// 计算 滑动到了第几页double page = scrollView.contentOffset.x / scrollView.width;self.pageControl.currentPage = (int)(page + 0.5);
}
// 只要滚动了就会调用
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {NSLog(@"ContentOffset x is %f,yis %f",scrollView.contentOffset.x,scrollView.contentOffset.y);}
#pragma mark - 将开始降速时
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView {
NSLog(@"开始减速了");
}
#pragma mark - 拖的过程 手指离开调用
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
NSLog(@"手指离开了");
}
#pragma mark - 手指开始 滑动调用
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
NSLog(@"手指滑动了");
}