You do not need to create a custom class. You can add UIToolBar category below
@implementation UIToolbar (UIToolbarCategory)
- (void)drawRect:(CGRect)rect {
UIColor *color = [UIColor colorWithRed:0.547 green:0.344 blue:0.118 alpha:1.000];
UIImage *img = [UIImage imageNamed: @"your-navbar-img.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
[img release];
self.tintColor = color;
[super drawRect:rect];
}
@end
I tested and works well.
P.S: 4.3 , , , 4.2. , , .
4.3 UIToolbar UINavigationBar, . 4.3
#import <UIKit/UIKit.h>
@interface MyAppToolBar : UIToolbar{
}
@end
@implementation MyAppToolBar
- (void)drawRect:(CGRect)rect {
[super drawRect:rect];
UIColor *color = [UIColor colorWithRed:0.547 green:0.344 blue:0.118 alpha:1.000];
UIImage *img = [UIImage imageNamed: @"your-navbar-img.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
[img release];
self.tintColor = color;
}
@end
, UIToolbar, XIB . , , UIImagePickerController .