iOS - 设置单边圆角

没设置之前的效果

// 单边圆角或者单边框

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 - 设置单边圆角)