标签:
//UIScrollView UITableView 上拉隐藏导航栏和tabbar 下拉显示导航栏和tabbar
-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
CGPoint translation = [scrollView.panGestureRecognizer translationInView:scrollView.superview];
if (translation.y < 0) {
[UIView animateWithDuration:0.5 animations:^{
self.chatImgTable.frame = CGRectMake(0, -64, ScreenWidth, ScreenHeight+64);
self.navigationController.navigationBar.frame = CGRectMake(0, -44, ScreenWidth, 44);
self.tabBarController.tabBar.frame = CGRectMake(0, ScreenHeight, ScreenWidth, 49);
} completion:^(BOOL finished) {
}];
} else {
//改变位置
[UIView animateWithDuration:0.5 animations:^{
self.navigationController.navigationBar.frame = CGRectMake(0, 20, ScreenWidth, 44);
self.tabBarController.tabBar.frame = CGRectMake(0, ScreenHeight -49, ScreenWidth, 49);
self.chatImgTable.frame=CGRectMake(0, 0, ScreenWidth, ScreenHeight-49);
} completion:^(BOOL finished) {
}];
}
}
UIScrollView UITableView 上拉隐藏导航栏和tabbar 下拉显示导航栏和tabbar
标签:
原文地址:http://www.cnblogs.com/huangzs/p/4616581.html