美文网首页
iOS OC 设置上下左右的圆角

iOS OC 设置上下左右的圆角

作者: Wougle | 来源:发表于2017-02-25 19:11 被阅读0次

以UILabel为例:

UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:label.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerTopLeft cornerRadii:CGSizeMake(3, 3)];

CAShapeLayer * maskLayer = [[CAShapeLayer alloc]init];

maskLayer.frame = label.bounds;

maskLayer.path = maskPath.CGPath;

label.layer.mask = maskLayer;

相关文章

网友评论

      本文标题:iOS OC 设置上下左右的圆角

      本文链接:https://www.haomeiwen.com/subject/aeogwttx.html