view的右上角及右下角添加圆角:
UIBezierPath *maskPath2 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, ScreenWidth - 15, self.warnView.height) byRoundingCorners:UIRectCornerBottomRight | UIRectCornerTopRight cornerRadii:CGSizeMake(self.warnView.height/2.0, self.warnView.height/2.0)];
CAShapeLayer *maskLayer2 = [[CAShapeLayer alloc] init];
maskLayer2.frame = CGRectMake(0, 0, ScreenWidth - 15, self.warnView.height);
maskLayer2.path = maskPath2.CGPath;
self.warnView.layer.mask = maskLayer2;
网友评论