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
Post a Comment