In need a background image AND a title in my Navigation Bar. For the image I write a category:
@implementation UINavigationBar(MyNavigationBar)
- (void)setBackgr
After IOS5 You should do this, for example in AppDelegate
UIImage *img = [[UIImage imageNamed:@"image.png"]resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UINavigationBar appearance] setBackgroundImage:img forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:0 green: 0 blue:0 alpha:1]];
I got it!
@implementation UINavigationBar(MyNavigationBar)
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed: @"navBarBackgrd.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
See Background image for navigation view