iOS判断UITableView的滑动方向

 1 -(void)scrollViewWillBeginDragging:(UIScrollView*)scrollView{
 2     lastContentOffset = scrollView.contentOffset.y;
 3     }
 4  -( void )scrollViewDidScroll:( UIScrollView *)scrollView {
 5     if (scrollView.contentOffset.y< lastContentOffset )
 6     {
 7     //向上
 8     [ self.navigationControllersetNavigationBarHidden : NOanimated : YES ];
 9     } else if (scrollView. contentOffset.y >lastContentOffset )
10     {
11     //向下
12     [ self.navigationControllersetNavigationBarHidden : YESanimated : YES ];
13     }
14     }

 

posted @ 2017-02-21 10:08  福泽小院  阅读(1762)  评论(0编辑  收藏  举报