//先實(shí)現(xiàn) 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)
}
}