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]; 

enter image description here

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

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

monitor web browser programmatically in Android? -

c# - Using multiple datasets in RDLC -