- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.contentInset = UIEdgeInsetsMake(kTopViewH * 0.5, 0, 0, 0);
UIImageView *topView = [[UIImageView alloc] init];
topView.image = [UIImage imageNamed:@"aaa"];
topView.frame = CGRectMake(0, -kTopViewH, kScreenW, kTopViewH);
topView.contentMode = UIViewContentModeScaleAspectFill;
[self.tableView insertSubview:topView atIndex:0];
self.topView = topView;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat down = -kTopViewH * 0.5 - scrollView.contentOffset.y;
NSLog(@"%f", down);
if (down < 0) return;
CGRect frame = self.topView.frame;
frame.size.height = kTopViewH + down;
self.topView.frame = frame;
}