вы можете получить помощь с этим
@implementation UINavigationBar (UINavigationBarCategory)
-(void)setBackgroundImage:(UIImage*)image{
if(!image) return;
UIImageView *aTabBarBackground = [[UIImageView alloc]initWithImage:image];
// aTabBarBackground.frame = CGRectMake(0,0,self.frame.size.width,self.frame.size.height);
aTabBarBackground.frame = CGRectMake(0,0,self.frame.size.width * .6,self.frame.size.height);
// [self addSubview:aTabBarBackground];
// [self sendSubviewToBack:aTabBarBackground];
[self insertSubview: aTabBarBackground atIndex: 0];
[aTabBarBackground release];
}
@end
у меня нормально работает
также у нас есть другая идея.
@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
// Drawing code
UIImage *img = [UIImage imageNamed: @"navbar_background.png"];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextDrawImage(context, CGRectMake(0, 0, 320, self.frame.size.height), img.CGImage);
}
@ Конец