美文网首页
iOS-利用UIBezierPath设置UIView的某几个角为

iOS-利用UIBezierPath设置UIView的某几个角为

作者: 香蕉你个菠萝 | 来源:发表于2018-06-04 11:44 被阅读18次
如题

示例代码

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;

相关文章

网友评论

      本文标题:iOS-利用UIBezierPath设置UIView的某几个角为

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