判断滑动方向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 ]; } }

 

posted on 2015-01-08 15:52  奋进的闹钟  阅读(666)  评论(0编辑  收藏  举报

导航