Can I give a UIToolBar a custom background in my iPhone app?

Answering my own question here!!! Overriding the drawRect function and creating an implementation of the UIToolbar does the trick 🙂

    @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

Leave a Comment