Created
December 16, 2011 18:02
-
-
Save larsacus/1487166 to your computer and use it in GitHub Desktop.
Round corner without clipsToBounds
This file contains hidden or 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
// Clips the bottom left corner to a radius | |
CGSize cornerSize = CGSizeMake(10,10); | |
UIBezierPath *roundRectMaskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds | |
byRoundingCorners:UIRectCornerBottomLeft | |
cornerRadii:cornerSize]; | |
CAShapeLayer *roundRectMaskLayer = [CAShapeLayer layer]; | |
roundRectMaskLayer.frame = self.view.bounds; | |
roundRectMaskLayer.path = roundRectMaskPath.CGPath; | |
view.layer.mask = roundRectMaskLayer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment