【发布时间】:2013-04-05 18:28:59
【问题描述】:
我正在尝试创建一个带有深灰色渐变的UIView:
UIView *sectionSpacer = [[UIView alloc] init];
sectionSpacer.backgroundColor = [UIColor clearColor];
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = sectionSpacer.bounds;
gradient.colors = [NSArray arrayWithObjects:(id)[RGB(80, 83, 88) CGColor], (id)[RGB(69, 71, 73) CGColor], nil];
[sectionSpacer.layer addSublayer:gradient];
由于某种原因,即使 RGB 值为深灰色,渐变视图也始终为蓝色。这是为什么呢?
【问题讨论】:
标签: ios objective-c uiview cagradientlayer