ios - Customizing elements -


i trying learn create customized elements. i'm starting navigation bar , trying make class red navigation bar.

i create class extends uinavigationbar , have code inside:

- (id)initwithframe:(cgrect)frame {     self = [super initwithframe:frame];     if (self) {         self.barstyle = uibarstyleblacktranslucent;         self.tintcolor = [uicolor redcolor];     }     return self;             } 

so lets see in scene have view. add navigation bar interface builder , set class use new class above. colors not changed. doing wrong?

the modifications have made in drawrect function. example, ended doing was:

- (void)drawrect:(cgrect)rect {     uicolor *color = [uicolor redcolor];     cgcontextref context = uigraphicsgetcurrentcontext();     cgcontextsetfillcolor(context, cgcolorgetcomponents( [color cgcolor]));     cgcontextfillrect(context, rect);     self.tintcolor = color; } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -