//先实现 UIScrollViewDelegate 代理
//headVIewHeight : tableview 的头试图高度
//headView : tableView 的头视图
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat yOffset =tbView.contentOffset.y;
CGFloat nowHeight =fabs(yOffset) + headVIewHeight;
CGFloat nowWid = (nowHeight /headVIewHeight) *kDeviceWidth;
if (yOffset < 0)
{
[headView setFrame:CGRectMake(-(nowWid -kDeviceWidth) / 2.0,-(nowHeight -headVIewHeight), nowWid, nowHeight)
}
}