UINavigationBar+background

#import

@interface UINavigationBar (Background)
- (void)setNavgationBarBg;
@end

#import "UINavigationBar+Background.h"

@implementation UINavigationBar (Background)

- (void)setNavgationBarBg
{
    UIImage * TitleBarImage = [UIImage imageNamed:@"Navigationbar_bg.png"];
    if([self respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)])
    {
        [self setBackgroundImage:TitleBarImage forBarMetrics:UIBarMetricsDefault];
    }
}
@end

UIToolbar+background

#import

@interface UIToolbar (Background)
- (void)setToolbarBg;
@end

#import "UIToolbar+Background.h"

@implementation UIToolbar (Background)

- (void)setToolbarBg
{
    UIImage * toolbarImage = [UIImage imageNamed:@"toolbar_bg.png"];
    if ([self respondsToSelector:@selector(setBackgroundImage:forToolbarPosition:barMetrics:)])
        [self setBackgroundImage:toolbarImage forToolbarPosition:UIToolbarPositionBottom barMetrics:UIBarMetricsDefault];
}
@end