title: Background image of UINavigationBar doesn't size correctly after orientation change on iPhone 5
body: <p>Long title for hopefully a small problem.</p>
  
  <p>I have a UINavigationBar with a custom background image. My app will support landscape orientation as well as portrait. Landscape works well in the simulator for retina 3 inch and non-retina screens. However, on the retina 4 inch screen, the background image is displayed twice its size in landscape mode.</p>
  
  <p>Here's the relevant code snippet from my custom navigation controller's init-method:</p>
  
  <pre><code>[self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar-bg.png"] forBarMetrics:UIBarMetricsDefault];        
  if (IS_IPHONE_5)
  {
      [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar-bg-landscape-iphone5.png"] forBarMetrics:UIBarMetricsLandscapePhone];
  }
  else
  {
      [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar-bg-landscape.png"] forBarMetrics:UIBarMetricsLandscapePhone];
  }
  </code></pre>
  
  <p>IS_IPHONE_5 is a macro defined as:</p>
  
  <pre><code>#define WIDTH_IPHONE_5 568
  #define IS_IPHONE_5 ([[UIScreen mainScreen] bounds].size.height == WIDTH_IPHONE_5)
  </code></pre>
  
  <p>Here 2 screen fragments that might explain things more clearly. When the app opens in portrait mode, everything is fine:</p>
  
  <p><img src="https://i.stack.imgur.com/cJfCA.png" alt="portrait"></p>
  
  <p>All blows up when changing to landscape mode:</p>
  
  <p><img src="https://i.stack.imgur.com/pRxoj.png" alt="landscape"></p>
  
  <p>The image sizes (in pixels, width x height) for the landscape version of the background image are:</p>
  
  <ul>
  <li>navbar-bg-landscape.png: 480x44</li>
  <li>navbar-bg-landscape@2x.png: 960x88</li>
  <li>navbar-bg-landscape-iphone5.png: 1136x88</li>
  </ul>
  
  <p>Or could it perhaps be a simulator only problem? (I don't have an actual iPhone 5 right now)</p>