代码:
UIView *one = [[UIView alloc]initWithFrame:CGRectMake(100, 200, 200, 200)];
one.backgroundColor = [UIColor colorWithRed:0.000 green:0.502 blue:1.000 alpha:1.000];
[self.view addSubview:one];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:one.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(20, 0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
maskLayer.frame = one.bounds;
maskLayer.path = maskPath.CGPath;
one.layer.mask = maskLayer;
效果图: