I’ve set a background image for my UINavigationBar using a subclass and overriding the DrawRect method as follows:
- (void)drawRect:(CGRect)rect {
// Drawing code
UIImage *img = [UIImage imageNamed: @"nav_bar.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
// Set tint colour
[self setTintColor:[UIColor blackColor]];
}
As you’ll see, I’ve also changed the tintColor of the nav bar so that my nav bar buttons automatically change colour.
My problem is that when you tap on (must be a proper name for the effect) one of the nav bar buttons, it doesn’t change to a different/lighter colour like the default nav bar style.
I’m also using a UISegmentControl in one of my nav bar’s and both the segment items appear with the same tint colour so you can’t tell which is currently selected, I assume that’s the same problem I’m having with the nav bar buttons.
Any help is much appreciated.
Thanks.
I think there is a colour change, but it is just not obvious. You either have to use a different tintColor, and create a custom UIBarButtonItem with custom image