objective c - Customizing UINavigationBar as in Fox news iPhone app -
how can uinavigationbar customizations done? using subclassing or categories?

i interested in 2 aspects:
- adding image navbar (like foxnews logo)
- customizing button "shows". (the button takes title of previous view in stack, there no title in previous view.)
thanks in advance
for fox news app looks set tint color of navigation bar. fox news logo, it's image view on title view of navigation bar. code goes view controller's viewdidload method:
[self.navigationcontroller.navigationbar settintcolor:/* custom color here */]; uiimageview *logoview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"logo"]]; [self.navigationitem settitleview:logoview]; [logoview release]; to customize button need place in viewdidload method of previous view controller (i.e. 1 button leads to):
uibarbuttonitem *backbutton = [[uibarbuttonitem alloc] initwithtitle:@"shows" style:uibarbuttonitemstylebordered target:nil action:nil]; [self.navigationitem setbackbarbuttonitem:backbutton]; [backbutton release]; if want use totally custom background image application's navigation bar, need create custom uinavigationbar category , draw image within drawrect: method. this:
@implementation uinavigationbar (uinavigationbarbackgroundimage) - (void)drawrect:(cgrect)rect { [[uiimage imagenamed:@"navigation-bar"] drawinrect:rect]; // optionally can set tintcolor here go background } @end
Comments
Post a Comment