监测uitableview 向上滑动和向下滑动的事件

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    CGFloat height = _varietyTableView.frame.size.height;
    CGFloat distanceFromButton = _varietyTableView.contentSize.height - _varietyTableView.contentOffset.y;
    if (distanceFromButton == height)
    {
        NSLog(@"=====滑动到底了");
    }
    
    if (_varietyTableView.contentOffset.y == 0)
    {
        NSLog(@"=====滑动到顶了");
    }
}

 

 

转:http://www.360doc.com/content/14/0508/15/11029609_375812938.shtml

 

posted @ 2014-09-28 15:20  ygm900  阅读(9395)  评论(0编辑  收藏  举报