Created
May 10, 2012 12:47
-
-
Save mundstein/2652825 to your computer and use it in GitHub Desktop.
Create a fancy shadow^
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Create a fancy shadow around the frontView. | |
* | |
* Note: UIBezierPath needed because shadows are evil. If you don't use the path, you might not | |
* not notice a difference at first, but the keen eye will (even on an iPhone 4S) observe that | |
* the interface rotation _WILL_ lag slightly and feel less fluid than with the path. | |
*/ | |
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:self.frontView.bounds]; | |
self.frontView.layer.masksToBounds = NO; | |
self.frontView.layer.shadowColor = [UIColor blackColor].CGColor; | |
self.frontView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f); | |
self.frontView.layer.shadowOpacity = 1.0f; | |
self.frontView.layer.shadowRadius = 2.5f; | |
self.frontView.layer.shadowPath = shadowPath.CGPath; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment