title: Set background image of UIBarButtonItem programmatically changes its size
body: <p>I've been able to have a custom UIBarButtonItem with an embedded uibutton through story board. It's the map button. 
  see parameters  on this screenshot, I had to use background property instead of Image. </p>
  
  <p><img src="https://i.stack.imgur.com/8ufwY.png" alt="map bar button"></p>
  
  <p>But when I tried to customize some uibarbuttons programmatically, then the buttons get smaller. I had the same result with the map button when I was using Image property. </p>
  
  <p>Here the code i'm writing for the back button, </p>
  
  <pre><code>UIImage *backButtonImage = [[UIImage imageNamed:@"Retour.png"]resizableImageWithCapInsets:UIEdgeInsetsMake(21, 21, 21, 21)] ;
  backButtonImage = [backButtonImage stretchableImageWithLeftCapWidth:0 topCapHeight:0];
  
  UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
   button.frame = CGRectMake(0, 0, backButtonImage.size.width, backButtonImage.size.height);
  [button setBackgroundImage:backButtonImage forState:UIControlStateNormal];
  [button setBackgroundImage:backButtonImage forState:UIControlStateHighlighted];
  
  [button addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
  UIBarButtonItem *backBarButton = [[UIBarButtonItem alloc] initWithCustomView:button] ;
  self.navigationItem.leftBarButtonItem = backBarButton;
  </code></pre>
  
  <p>I tried with or without resizableImageWithCapInsets, stretchableImageWithLeftCapWidth with the same result below (the back button should have the same size as the map button)</p>
  
  <p>I tried also iOS 5 setBackButtonBackgroundImage methods but the button was not customized at all. </p>
  
  <p><img src="https://i.stack.imgur.com/wKyr3.png" alt="navigation toolbar"></p>