View自定义圆角-(贝塞尔曲线实现)
2017-02-20 本文已影响0人
冬的天
实例代码如下(效果如下图所示):
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.contentView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *mackLayer = [[CAShapeLayer alloc] init];
mackLayer.frame = self.contentView.bounds;
mackLayer.path = maskPath.CGPath;
self.contentView.layer.mask = mackLayer;