-(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 ];
}
}