I tried this code on IOS 4+ and it works perfectly, but not until my teammates tested it on IOS 5+. This is the code
@implementation UINavigationBar (CustomImage)
// Set the navigation bar background
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed:@"background.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
I need a code that works on IOS 4+ and IOS 5+, please help me.
Please try this one:
The setBackgroundImage:forBarMetrics: applies on iOS5