您的位置:首页 > 产品设计 > UI/UE

UIBezierPath加圆角

2016-02-17 09:45 232 查看
    UIButton *button = [UIButton
buttonWithType:UIButtonTypeCustom];
    button.backgroundColor = [UIColor
redColor];
    button.frame =
CGRectMake(0,
0, 100,
44);
    CGRect bounds = button.bounds;
    UIBezierPath *path = [UIBezierPath
bezierPathWithRoundedRect:bounds
cornerRadius:frame.size.width/2];
    CAShapeLayer *shapeLayer = [CAShapeLayer
layer];
    shapeLayer.frame = bounds;
    shapeLayer.path = path.CGPath;
    button.layer.mask = shapeLayer;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios