Created
August 20, 2015 02:27
-
-
Save warriorg/5bdaa77c28f2b3cec0f5 to your computer and use it in GitHub Desktop.
底部加圆角
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
UIBezierPath * bezierPath = [UIBezierPath bezierPathWithRoundedRect:topicView.bounds | |
byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight | |
cornerRadii:CGSizeMake(5, 5)]; | |
CAShapeLayer *maskLayer = [CAShapeLayer layer]; | |
maskLayer.frame = topicView.bounds; | |
maskLayer.path = bezierPath.CGPath; | |
topicView.layer.mask = maskLayer; | |
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, ScreenWidth - 10, 44) | |
byRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerBottomRight) | |
cornerRadii:CGSizeMake(10.0, 10.0)]; | |
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; | |
maskLayer.frame = CGRectMake(0, 0, ScreenWidth - 10, 44); | |
maskLayer.path = maskPath.CGPath; | |
bottomView.layer.mask = maskLayer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment