Created
October 25, 2011 10:11
-
-
Save tudormunteanu/1312148 to your computer and use it in GitHub Desktop.
UIView with rounded corners
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
UIView *container = [[UIView alloc] initWithFrame:rect]; | |
// radius | |
container.layer.cornerRadius = 5; | |
// shadow path | |
container.layer.cornerRadius = 20; | |
container.layer.shadowColor = [[UIColor blackColor] CGColor];; | |
container.layer.masksToBounds = NO; | |
container.layer.shadowOffset = CGSizeMake(0, -10); | |
container.layer.shadowOpacity = 0.4; | |
CGPathRef shadowPath = [UIBezierPath bezierPathWithRect:CGRectInset(container.layer.bounds, 0, 0)].CGPath; | |
container.layer.shadowPath = shadowPath; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment