美文网首页
47.渐变色

47.渐变色

作者: bytebytebyte | 来源:发表于2021-01-25 15:05 被阅读0次
CAGradientLayer *gl = [CAGradientLayer layer];
gl.frame = CGRectMake(0, 0, 95, 60);
gl.startPoint = CGPointMake(0, 0);
gl.endPoint = CGPointMake(1, 1);
gl.colors = @[
(__bridge id)[UIColor colorWithRed:247/255.0 green:201/255.0 blue:104/255.0 alpha:1.00].CGColor,
(__bridge id)[UIColor colorWithRed:255/255.0 green:179/255.0 blue:64/255.0 alpha:1.00].CGColor,
];
gl.locations = @[@(0),@(1.f)];
[self.layer insertSublayer:gl atIndex:0];

相关文章

网友评论

      本文标题:47.渐变色

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