taiyang2014

判断tableVIew滑动的方向

首先设置一个旧的偏移量为0;

 self.oldContent = 0;

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

    if (scrollView.contentOffset.y > _oldContent) {

    //如果当前位移大于缓存位移,说明是tableView向下移动

        [self foldingViewDidAnimateToFold];

     } else {

        [self foldingViewDidAnimateToFlat];

    }

    _oldContent = scrollView.contentOffset.y;

}

 

posted on 2015-05-13 14:02  taiyang2014  阅读(214)  评论(0编辑  收藏  举报

导航