// 滚动视图
-(void)scrollViewDidScroll:(UIScrollView*)scrollView
{
//设置偏移量
if(scrollView.contentOffset.y>0)
{
self.navigationItem.title = @"隐藏的导航栏";
self.headerView.hidden=YES;
self.search.hidden=YES;
self.tableView.frame = CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height - 64);
}
if(scrollView.contentOffset.y<=0)
{
self.navigationItem.title = @"";
self.headerView.hidden=NO;
self.search.hidden=NO;
self.tableView.frame = CGRectMake(0, 124, self.view.frame.size.width, self.view.frame.size.height - 124);
}
}
网友评论