Skip to content

Instantly share code, notes, and snippets.

@florieger
Created April 5, 2012 12:21
Show Gist options
  • Save florieger/2310609 to your computer and use it in GitHub Desktop.
Save florieger/2310609 to your computer and use it in GitHub Desktop.
UIView shadow
#import <QuartzCore/QuartzCore.h>
self.view.layer.masksToBounds = NO;
self.view.layer.shadowColor = [[UIColor blackColor] CGColor];
// Offset to bottom, left
self.view.layer.shadowOffset = CGSizeMake(-1,1);
self.view.layer.shadowRadius = 10;
self.view.layer.shadowOpacity = 1;
// Set shadow path property to improve performance when animating the view
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment