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 }
我的心愿是什么呢