title: View Frame differs IOS 4.3 vs IOS 5.1 -- Why?
body: <p>In laying out CALayer objects in the main view of a viewController I am seeing a discrepancy between IOS 43. and 5.1</p>
  
  <p>I am running in landscape mode.  I want a CALayer object 40 pts wide, showing at the top left -- butted up against the nav bar and the full height of the screen (less the nav bar).  Status bar is disabled. I calculate the height of the layer as the height of the view less the height of the nav bar.</p>
  
  <p>In viewDidLoad of my viewController I have the following code....</p>
  
  <pre><code>[[UIApplication sharedApplication] setStatusBarHidden:YES];
  CGRect viewFrame = self.view.frame;
  float navBarHeight = self.navigationController.navigationBar.frame.size.height;
  
  CGRect f = CGRectMake( 0, navBarHeight, 40, viewFrame.size.height - navBarHeight);
  leftLayer = [[CALayer alloc] init];
  leftLayer.frame = f;
  leftLayer.backgroundColor = [UIColor greenColor].CGColor;  // for debug
  [self.view.layer addSublayer:leftLayer];
  </code></pre>
  
  <p>When I run this on 5.1 viewFrame = (0, 0, 480, 288) and navBarHeight = 32.  When I run this on 4.3 viewFrame = (0, 0, 480, 320) and navBarHeight = 32.  I've tried the same comparison in portrait mode and there is no discrepancy between OS versions.   </p>
  
  <p>navBarHeight also seems wrong -- because my green CALayer object has about 12 pts of white space between it and the nav bar.   What am I doing wrong?</p>