判断scrollView 的滚动方向

2018-07-11  本文已影响12人  进击的小巨牛
    CGPoint point = [scrollView.panGestureRecognizer translationInView:self.view];
    if (point.y > 0) {
        //向下滚动
    } else {
        //向上滚动
    }
    if (self.lastContentOffset > scrollView.contentOffset.y) {
        //向下滚动
    } else {
        //向上滚动
    }
    self.lastContentOffset = scrollView.contentOffset.y;
}
上一篇 下一篇

猜你喜欢

热点阅读