来自:http://blog.csdn.net/caryaliu/article/details/7907196
- int _lastPosition=0;
- - (void)scrollViewDidScroll:(UIScrollView *)scrollView{
- int currentPostion = scrollView.contentOffset.y;
- if (currentPostion - _lastPosition > 25) {
- _lastPosition = currentPostion;
- NSLog(@"ScrollUp now");
- }
- else if (_lastPosition - currentPostion > 25)
- {
- _lastPosition = currentPostion;
- NSLog(@"ScrollDown now");
- }
- }
- 25 可以是任意数字,可根据自己的需要来设定。