美文网首页
设置控件圆角

设置控件圆角

作者: PerhapYs | 来源:发表于2017-10-25 11:35 被阅读24次

-(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];

}

相关文章

网友评论

      本文标题:设置控件圆角

      本文链接:https://www.haomeiwen.com/subject/kfhqpxtx.html