a - (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.contentInset = UIEdgeInsetsMake(kImageOriginHight, 0, 0, 0);
[self.tableView addSubview:self.expandZoomImageView];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
self.expandZoomImageView.frame = CGRectMake(0, -kImageOriginHight, self.tableView.frame.size.width, kImageOriginHight);
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
CGFloat yOffset = scrollView.contentOffset.y;
if (yOffset < -kImageOriginHight) {
CGRect f = self.expandZoomImageView.frame;
f.origin.y = yOffset;
CGFloat factor = ((fabs(yOffset)+kImageOriginHight)*self.view.frame.size.width)/kImageOriginHight;
f.origin.x = -(factor/2-self.view.frame.size.width)/2;
f.size.width = factor/2;
f.size.height = (kImageOriginHight+fabs(yOffset))/2;
self.expandZoomImageView.frame = f;
}
}