title: Setting a background image on a tab bar
body: <p>I had the following code in place which was putting a nice image in the background of my tabbar, but its stopped working. Has anyone got any other suggestions as to what I can do. I've tried a few other options as seen here: <a href="https://stackoverflow.com/questions/8909379/setting-a-background-image-for-a-tabbar">Setting a background image for a tabbar</a></p>
  
  <pre><code>-(void)viewDidLoad 
  {
      CGRect frame = CGRectMake(0, 0, 480, 49);
      UIView *v = [[UIView alloc] initWithFrame:frame];
      UIImage *i = [UIImage imageNamed:@"smallMenuBackground.png"];
      UIColor *c = [[UIColor alloc] initWithPatternImage:i];
      v.backgroundColor = c;
      [c release];
      [mainTabBar insertSubview:v atIndex:0]; 
      [v release];
      [super viewDidLoad];
  }
  </code></pre>
  
  <p>Any help appreciated.</p>
  
  <p><em>UPDATE 23rd January 2012</em></p>
  
  <p>Ok, I've made a bit of progress. This only stopped working since I upgraded to Xcode 4.2 and IOS5. I managed to get it back using the options in Interface Builder, but now it only works for IOS5. Ideally I would have liked to get working programatically but I'll settle for the IB solution for now.</p>
  
  <p>I just can't seem to get it working for any previous releases.</p>
  
  <p>NOTE: my TabBar is only on my rootviewcontroller and no other screens.</p>
  
  <p>Regards, Stephen</p>