【发布时间】:2014-10-21 09:51:39
【问题描述】:
我想创建一个如下图所示的视图
为了实现这一点,我尝试了以下方法:
UIView *myView = [[UIView alloc] init];
imgView.frame = CGRectMake(50, 150, 200, 200);
[self.view addSubview:imgView];
UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:myView.bounds
byRoundingCorners:UIRectCornerTopRight
cornerRadii:CGSizeMake(50.0, 50.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = myView.bounds;
maskLayer.path = maskPath.CGPath;
myView.layer.mask = maskLayer;
但它对我不起作用。有人可以帮帮我吗?
【问题讨论】:
标签: ios calayer uibezierpath cgpath cashapelayer