我有以下代码来创建渐变(或渐变的开始):
CAGradientLayer *gradient = [CAGradientLayer layer];
UIColor *lightGreen = [UIColor colorWithRed:66.0f/255.0f green:79.0f/255.0f blue:91.0f/255.0f alpha:1.0f];
UIColor *darkGreen = [UIColor colorWithRed:66.0f/255.0f green:79.0f/255.0f blue:91.0f/255.0f alpha:1.0f];
为什么这条线给我“预期的标识符”?
gradient.colors = [NSArray arrayWithObjects:(id)[lightGreen.CGColor]];