ios view 绘制圆角
作者:
jfzhang | 来源:发表于
2021-02-03 13:37 被阅读0次//绘制圆角
+(void)drawCorners:(UIView *)view byRoundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii
{
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:corners cornerRadii:cornerRadii];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = view.bounds;
maskLayer.path = maskPath.CGPath;
view.layer.mask = maskLayer;
}
本文标题:ios view 绘制圆角
本文链接:https://www.haomeiwen.com/subject/lfnptltx.html
网友评论