【发布时间】:2016-10-16 23:42:11
【问题描述】:
我有蓝色 UIView,我想要顶角。
这是我的代码:
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.backgroundContentView.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight) cornerRadii:CGSizeMake(20.0, 20.0)];
CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
shapeLayer.frame = self.backgroundContentView.bounds;
shapeLayer.path = path.CGPath;
self.backgroundContentView.layer.mask = shapeLayer;
但我只有左上角。为什么?
【问题讨论】:
-
它没有帮助。结果是一样的
标签: ios objective-c uiview