views:

207

answers:

1

Hi

I want to use my self background for my UIToolbar.

To do that with the UINavigationBar I've just used this category with the override of the drawRect method:

    @implementation UIToolbar (CustomImage)

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

This piece of code works perfectly for the UINavigationBar but this does not work for the UIToolbar that is inncluded in the UINavigationController and enabled with this line o code:

self.navController.toolbarHidden = NO;

Can anyone help me with the problem? I' m sure that the UINavigationController use a standard UIToolbar so why this not works?!? thanks

A: 

Try this post: http://stackoverflow.com/questions/1414510/how-do-you-add-more-than-one-uibarbutton-on-uinavigationitem-rightbarbuttonitem

I also found you have to set your UIToolbar background to clear:

    [toolbar setBackgroundColor:[UIColor clearColor]];
Evan