i would like to ask you, if somebody know how to create a shadow at the end of table view as it is shown in the image bellow (click on the href :)). Best regards
Martin
i would like to ask you, if somebody know how to create a shadow at the end of table view as it is shown in the image bellow (click on the href :)). Best regards
Martin
The code for the top gradient, don't forget to import QuartzCore/QuartzCore.h
The .view
is view controllers outlet View (UIView), the table view is it's subview.
- (void)viewDidLoad
{
UIView *gradientView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)] autorelease];
CAGradientLayer *gradient = [CAGradientLayer layer];
[gradient setFrame:gradientView.bounds];
gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor blackColor] CGColor], (id)[[UIColor clearColor] CGColor], nil];
[self.view.layer addSublayer:gradient];
[super viewDidLoad];
}
Or you can always draw the gradient image and add it as a subview (on the root view after the scroll view, not on the scroll view directly to prevent the image from scrolling).