通过使用[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]
,我可以创建一个圆形视图,例如:
我怎么能从这条路径(或其他方式)中减去另一条路径,以创建这样的路径:
有什么办法可以做这样的事情吗?伪代码:
UIBezierPath *bigMaskPath = [UIBezierPath bezierPathWithRoundedRect:bigView.bounds
byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)
cornerRadii:CGSizeMake(18, 18)];
UIBezierPath *smallMaskPath = [UIBezierPath bezierPathWithRoundedRect:smalLView.bounds
byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)
cornerRadii:CGSizeMake(18, 18)];
UIBezierPath *finalPath = [UIBezierPath pathBySubtractingPath:smallMaskPath fromPath:bigMaskPath];