设置控件圆角
2017-10-25 本文已影响24人
PerhapYs
-(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];
}