判断scrollView、tableView滚动方向(上或下)
float lastContentOffset;
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
lastContentOffset = scrollView.contentOffset.y;
}
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView
{
if (lastContentOffset < scrollView.contentOffset.y){
NSLog(@"向上滚动");
}else{
NSLog(@"向下滚动");}
}
网友评论