<分区>
<分区>
我有一个要求,我需要用指定的半径裁剪 UIImage 的右上角和右下角。最终输出应如下图的 coreners 所示
谁能帮帮我吗?
最佳答案
UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:_backgroundImageView.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerBottomRight)cornerRadii:CGSizeMake(5.0, 5.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.bounds;
maskLayer.path = maskPath.CGPath;
_backgroundImageView.layer.mask = maskLayer;
self
是我的自定义表格 View 单元格。
关于ios - 如何将图像裁剪成圆角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24955085/