if (!statusBarBackgroundView) {
CGRect barRect = CGRectMake(0.0f, 0.0f, 320.0f, 30.0f);
statusBarBackgroundView = [tableView.backgroundView resizableSnapshotViewFromRect:barRect afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero];
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
NSArray *colors = [NSArray arrayWithObjects:
(id)[[UIColor colorWithWhite:0 alpha:0] CGColor],
(id)[[UIColor colorWithWhite:0 alpha:1] CGColor],
nil];
[gradientLayer setColors:colors];
[gradientLayer setStartPoint:CGPointMake(0.0f, 1.0f)];
[gradientLayer setEndPoint:CGPointMake(0.0f, 0.0f)];
[gradientLayer setFrame:[statusBarBackgroundView bounds]];
[[statusBarBackgroundView layer] setMask:gradientLayer];
[self.view addSubview:statusBarBackgroundView];
}