美文网首页
设置指定某个角为圆角

设置指定某个角为圆角

作者: lixiangdev | 来源:发表于2016-12-30 09:51 被阅读0次
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view2.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = view2.bounds;maskLayer.path = maskPath.CGPath;
view2.layer.mask = maskLayer;

指定角参数是

* UIRectCornerTopLeft
* UIRectCornerTopRight
* UIRectCornerBottomLeft
* UIRectCornerBottomRight
* UIRectCornerAllCorners
//用“|”分隔开

相关文章

网友评论

      本文标题:设置指定某个角为圆角

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