title: UINavigation bar button background image size
body: <p>I'm trying sot set image background for the left back button navigation bar for all the app with this snippet:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
  
      float version = [[[UIDevice currentDevice] systemVersion] floatValue];
      if (version &gt;= 5.0)
      {
          // iPhone 5.0 code here
          UIImage *image = [UIImage imageNamed: @"btn_back.png"];
           image = [image stretchableImageWithLeftCapWidth:40.0f topCapHeight:0.0f];
          [[UIBarButtonItem appearance] setBackButtonBackgroundImage:image forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
  
      }
      return YES;
  }
  </code></pre>
  
  <p>I've been trying different values in stretchableImageWithLeftCapWidth: but best result was this:</p>
  
  <p><img src="https://i.stack.imgur.com/VRhDC.png" alt="enter image description here"></p>
  
  <p>How can I set background image to the correct size?</p>
  
  <p>Thanks</p>