(Objective-C) UIView指定方向设置圆角
作者:
布呐呐u | 来源:发表于
2024-08-13 09:47 被阅读0次
UIView *testView = UIView.new;
testView.frame = CGRectMake(0, 0, 200, 200);
testView.center = self.center;
[self addSubview:testView];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:testView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = testView.bounds;
maskLayer.path = maskPath.CGPath;
testView.layer.mask = maskLayer;
本文标题:(Objective-C) UIView指定方向设置圆角
本文链接:https://www.haomeiwen.com/subject/iuzdkjtx.html
网友评论