Skip to content

Instantly share code, notes, and snippets.

@jallen
jallen / gist:4264455
Created December 12, 2012 02:53
Drop Shadow on UIView using Quartz
#import <QuartzCore/QuartzCore.h>
UIView *shadowView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenWidth)];
shadowView.layer.shadowColor = [UIColor blackColor].CGColor;
shadowView.layer.shadowOpacity = 0.5;
shadowView.layer.shadowOffset = CGSizeMake(0, 2);
shadowView.layer.shadowPath = [UIBezierPath bezierPathWithRect:shadowView.frame].CGPath;
shadowView.layer.shadowRadius = 2.0f;
shadowView.layer.masksToBounds = NO;
[self.view addSubview:shadowView];