判断滑动方向UITableView

CGFloat lastContentOffset;  //ScoreView 滑动位置


-(void)scrollViewWillBeginDragging:(UIScrollView*)scrollView{ lastContentOffset = scrollView.contentOffset.y; } -( void )scrollViewDidScroll:( UIScrollView *)scrollView { if (scrollView. contentOffset.y < lastContentOffset ) { //向上,隐藏导航栏 [ self.navigationController setNavigationBarHidden : NO animated : YES ]; } else if (scrollView. contentOffset.y > lastContentOffset ) { //向下 [ self.navigationController setNavigationBarHidden : YES animated : YES ]; } }

 

你可能感兴趣的:(UITableView)