title: ios 5 change the background of back button in navigation controller to transparent
body: <p>I have customised the navigation controller title bar with a background image, but I am really struggling to change the background color of the back button to transparent so that it matches with the green title bar beneath it. I am fairly new to iOS development. Can any one suggest what could be done?</p>
  
  <p>Here is the code for I used to change the title bar of navigation controller, just in case  it helps:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
      if ([self.navigationController.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] ) {
          UIImage *image = [UIImage imageNamed:@"greenbar.png"];
          [self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
         // [[UIBarButtonItem appearance] setBackButtonBackgroundImage:image forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
  
      } 
  
      //change back button image
  
  }
  </code></pre>
  
  <p><strong>EDIT</strong>: After doing a bit of research I managed to get what I wanted. Here is the code to change the background image for the back button:</p>
  
  <pre><code> UIImage *image1 = [UIImage imageNamed:@"back-bt.png"];
      [[UIBarButtonItem appearance] setBackButtonBackgroundImage:image1 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
  </code></pre>
  
  <p>The above code adds the image to all the back buttons in the navigation controller.</p>