一、写一个category
@implementation UINavigationBar(customImage)
-(void)drawRect:(CGRect)rect{
UIImage *backgroundImage = [UIImage imageNamed:@"背景.png"];
[backgroundImage drawInRect:CGRectMake(0, 0, 320, 44)];
}
@end
二、首先引入#import <QuartzCore/QuartzCore.h>,之后
self._navigationController.navigationBar.layer.contents=(id)[UIImage imageNamed:@"背景.png"].CGImage;
三、将有的navigationBar隐藏掉,自己写一个,当然返回的方法也得自己来写了