判断UIScrollView滚动方向
2017-10-31 本文已影响10人
我的名字就这么长
- (void)scrollViewDidScroll:(UIScrollView*)scrollView{
staticfloatnewy =0;
staticfloatoldy =0;
newy= scrollView.contentOffset.y;
if(newy != oldy ) {
if(newy > oldy) {
NSLog(@"scrollViewDidScroll上");
}elseif(newy < oldy){
NSLog(@"scrollViewDidScroll下");
}
oldy = newy;
}
}