美文网首页程序员
iOS - 设置单边圆角

iOS - 设置单边圆角

作者: 一个写代码的文艺姑娘 | 来源:发表于2018-02-06 11:19 被阅读698次

没设置之前的效果

// 单边圆角或者单边框

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_testLab.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerBottomRight) cornerRadii:CGSizeMake(5,5)];

//圆角大小 CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

maskLayer.frame = _testLab.bounds;

maskLayer.path = maskPath.CGPath;

_testLab.layer.mask = maskLayer;

相关文章

网友评论

    本文标题:iOS - 设置单边圆角

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