320为headView本身高度
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat width = [UIScreen mainScreen].bounds.size.width;
CGFloat yOffset = scrollView.contentOffset.y;
if (yOffset < 0) {
CGFloat totalOffset = 320 + ABS(yOffset);
CGFloat f = totalOffset / 320;
_headImageView.frame = CGRectMake(- (width * f - width) / 2, yOffset, width * f, totalOffset);
}
}