设置控件圆角

-(void)setViewStyle:(UIView *)view{

UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds
                                                byRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerBottomRight)
                                                      cornerRadii:CGSizeMake(setWidth(10), setHight(10))];
CAShapeLayer * maskLayer = [CAShapeLayer layer];
maskLayer.frame  = view.bounds;
maskLayer.path   = maskPath.CGPath;
view.layer.mask  = maskLayer;
[view.layer setMasksToBounds:YES];

}

你可能感兴趣的:(设置控件圆角)