Skip to content

Instantly share code, notes, and snippets.

@tmdvs
Created March 14, 2011 20:20
Show Gist options
  • Save tmdvs/869789 to your computer and use it in GitHub Desktop.
Save tmdvs/869789 to your computer and use it in GitHub Desktop.
Using CALayers for dynamic shadows
UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(30, 30, 260, 260)];
/* It's important to remember to pass CG structs like floats and CGColors */
[[myView layer] setShadowOffset:CGSizeMake(0, 1)];
[[myView layer] setShadowColor:[[UIColor darkGrayColor] CGColor]];
[[myView layer] setShadowRadius:3.0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment