views:

84

answers:

3

Hi all,

Is there a way to add an image in the background of UINavigationBar. There is no direct option through interface builder but I have seen apps implemented this thing.

Any help would be appreciated.

Thanks

A: 

Create a UIView and add it as a subview.

jrtc27
A: 

Just add your background as a subview, as jrtc27 suggested and change the tint color according your needs.

nacho4d
A: 

You can also override the drawRect function.

@implementation UINavigationBar (UINavigationBarCustom)

  • (void)drawRect:(CGRect)rect {

    UIImage *image = [UIImage imageNamed:@"nav_bar_logo.png"]; [image drawInRect:rect]; }

@end

Charter