UIImageView *myView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
myView.backgroundColor = [UIColor greenColor];
[self addSubview:myView];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:myView.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake([Scale myWidth:3.f], [Scale myWidth:3.f])]; // UIRectCornerBottomRight通过这个设置
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = myView.bounds;
maskLayer.path = maskPath.CGPath;
myView.layer.mask = maskLayer;