In my tabBar based app I have subclassed the UINavigationBar. Let's say I have three of them: BlueNavBar, BlackNavBar and RedNavBar. It looks something like this:
//BlueNavBar.m
- (void)drawRect:(CGRect)rect {
self.tintColor = [UIColor colorWithRed:65.0f/255.0f green:(156.0f/255.0f) blue:(215.0f/255.0f) alpha:1.0];
UIImage *image = [[UIImage imageNamed:@"blueNavBar.png"]retain];
[image drawInRect:rect];
[image release];
}
I've assigned the subclassed navigationbar for each tab with Interface Builder. That is working great, no problems there.
In some viewControllers however i want to change the navigationBar during "pushViewController". Let's say I want to change the current navigationbar (which is for e.g. BlueNavBar) to the RedNavBar. How can I do this programmatically, without Interface Builder?