【发布时间】:2016-11-04 09:43:03
【问题描述】:
这里我正在使用此代码来提供渐变效果,但根本没有得到效果。
CAGradientLayer *layer2 = [CAGradientLayer layer];
NSArray *gradientColors = [NSArray arrayWithObjects:(id)[self colorWithHexString:@"3eb79d"].CGColor,(id)[self colorWithHexString:@"3fb65c"].CGColor,(id)[self colorWithHexString:@"3cb7da"].CGColor, nil];
[layer2 setColors:gradientColors];
[layer2 setFrame:cell.userBackgroundView.layer.frame];
[cell.userBackgroundView.layer insertSublayer:layer2 atIndex:0];
cell.userBackgroundView.clipsToBounds = YES;
【问题讨论】:
标签: ios objective-c gradient