```
UIView*view2=[[UIViewalloc]initWithFrame:CGRectMake(120,10,80,80)];
view2.backgroundColor=[UIColorredColor];[self.viewaddSubview:view2];
UIBezierPath*maskPath=[UIBezierPathbezierPathWithRoundedRect:view2.boundsbyRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRightcornerRadii:CGSizeMake(10,10)];
CAShapeLayer*maskLayer=[[CAShapeLayeralloc]init];
maskLayer.frame=view2.bounds;maskLayer.path=maskPath.CGPath;view2.layer.mask=maskLayer;
```
其中byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight指定了需要成为圆角的角。该参数是UIRectCorner类型的,可选的值有* UIRectCornerTopLeft* UIRectCornerTopRight* UIRectCornerBottomLeft* UIRectCornerBottomRight* UIRectCornerAllCorners从名字很容易看出来代表的意思,使用“|”来组合就好了。