Note There is a way better solution for this, and iOS 5 has built-in methods as well.
Sometimes it is nice to have a custom background for UINavigationBar. However it is not supported via properties/methods,
but you can create your own category class of UINavigationBar in Application Delegate class or any other file in your app code.
@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed: @"NavigationBar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
Source: Stackoverflow.com