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

 

相关文章:

  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案