Question: Can I do this without overriding the `drawRect` method?

I've tried the following:

```
UIImage *navBarImage = [[UIImage imageNamed:@"image_navbg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(5, 5, 5, 5)];
[self.descriptionBar setBackgroundColor:[UIColor colorWithPatternImage:navBarImage]];
[self.bottomBar setBackgroundColor:[UIColor colorWithPatternImage:navBarImage]];

```

Where image\_navbg.png is a solid matte black square. The result I get still has a black - gray gradient.

Also setting these did not help:

```
[self.descriptionBar setTranslucent:YES];
[self.bottomBar setTranslucent:YES];

```

Answer: 
If you’re targeting iOS 5, use [UIAppearance](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html) for this — don’t override `-drawRect:` anymore.
This is the way I did it. Worked great for me. You might have to try different indexes in your subviews.

```
// Change color of searchbar
[[self.searchbar.subviews objectAtIndex:0] removeFromSuperview];
self.searchbar.backgroundColor = [UIColor blackColor];

// Change color of toolbar
[[self.toolbar.subviews objectAtIndex:0] removeFromSuperview];
self.toolbar.backgroundColor = [UIColor blackColor];

```