相关疑难解决方法(0)

如何只为UIView的左上角和右上角设置cornerRadius?

有没有办法cornerRadius只设置一个左上角和右上角UIView

我尝试了以下内容,但最终没有看到视图了.

UIView *view = [[UIView alloc] initWithFrame:frame];

CALayer *layer = [CALayer layer];
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRoundedRect:frame byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight) cornerRadii:CGSizeMake(3.0, 3.0)];
layer.shadowPath = shadowPath.CGPath;
view.layer.mask = layer;
Run Code Online (Sandbox Code Playgroud)

cocoa-touch cornerradius uiview ios

372
推荐指数
20
解决办法
21万
查看次数

标签 统计

cocoa-touch ×1

cornerradius ×1

ios ×1

uiview ×1