Skip to content

Instantly share code, notes, and snippets.

@zhuixinjian
Forked from jallen/gist:4264455
Created December 12, 2012 03:07
Show Gist options
  • Select an option

  • Save zhuixinjian/4264535 to your computer and use it in GitHub Desktop.

Select an option

Save zhuixinjian/4264535 to your computer and use it in GitHub Desktop.
#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];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment