static CGFloat headerHeight = 250;
static CGFloat headerWidth = 320;
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat yOffset = _collectionView.contentOffset.y;
if (yOffset < 0) {
CGFloat factor = ((ABS(yOffset)+headerHeight)*headerWidth)/headerHeight;
CGRect f = CGRectMake(-ABS(yOffset)/2,-ABS(yOffset), factor, headerHeight+ABS(yOffset));
_header.imageView.frame = f;
} else {
CGRect f = _header.frame;
f.origin.y = 0;
_header.frame = f;
}
}