ios - UIView Gradient using CAGradientLayer always blue -
i trying create uiview
dark gray gradient:
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];
for reason gradient view blue thought rgb values dark grays. why this?
if init
view without frame, it'll default cgrectzero
, layer have 0
width , height, why don't see (the gradient see looks standard uitableview
header may come elsewhere, doubt same view you're initializing in code you've shown).
Comments
Post a Comment