项目中用到下滑隐藏tabbar,上滑显示。 虽然实现起来非常简单,还是记录一下。
-(void)scrollViewDidScroll:(UIScrollView*)scrollView
{
intcurrentPoint=scrollView.contentOffset.y;
if(currentPoint-preventPoint>20&¤tPoint!=0){
preventPoint=currentPoint;
NSLog(@"下滑");
self.tabBarController.tabBar.hidden=YES;
}elseif((preventPoint-currentPoint>20)&&(currentPoint <=scrollView.contentSize.height-scrollView.bounds.size.height-20)){
preventPoint=currentPoint;
NSLog(@"上滑");
self.tabBarController.tabBar.hidden=NO;
}
}