views:

80

answers:

1

how can i set an image into the background of the navigation-bar, so that is also in the background of the back-button ? now i have an image with a with of 320 pixels, but it shrinks that image so, that the left back-button is the standard-button and on the right side there are 5 pixels in the standard-blue. i want that this image is over the fuel width and maybe i will do a darker back-button later.

A: 
@implementation UINavigationBar (UINavigationBarCategory)

- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed: @"titlebar.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}


@end

i have found this snippet. so the image is on every navigationbar as background and i can set the old image as the view in the middle. maybe i dont understand why that works, but it works. sorry for the dumb question.

nico