title: iPhone: UINavigationBar with buttons - adjust the height
body: <p>I am working on an iPhone application which works in both orientations: portrait and landscape.</p>
  
  <p>I am using for one view and tableview embedded in an UINavigationController. The height of this navigationbar with its buttons is either: 44px portrait or 34px landscape. </p>
  
  <p>Within a different view I created the UINavigationBar by myself and I am able to set the frame for the correct size, but the embedded UINavigationItem with UIBarButtonItem doesn't shrink. So for the 34 px in the landscape mode this button is to big and overlaps the navbar in the height.</p>
  
  <p>The funny thing is though, that this worked with identical code in other apps... have no idea which it isn't here.</p>
  
  <p>Is there anyway to adjust the height / position of an UIBarButtonItem?</p>
  
  <p>Here is the code snippet:</p>
  
  <pre><code>    navBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 34.0f)];
  [navBar setBarStyle: UIBarStyleBlackOpaque];
  
  [self addSubview: navBar];
  
  barButton = [[UIBarButtonItem alloc] initWithTitle: NSLocalizedString(@"flip", @"flip") style:UIBarButtonItemStylePlain target:self action:@selector(flip)];
  
  item = [[UINavigationItem alloc] initWithTitle: NSLocalizedString(@"Translation", @"Translation Tab Bar Title")];
  [item setRightBarButtonItem: barButton];
  [navBar pushNavigationItem:item animated:NO];   
  </code></pre>
  
  <p><a href="http://labs.kiesl.eu/images/navbar.png">alt text http://labs.kiesl.eu/images/navbar.png</a></p>
  
  <p>Thanks</p>
  
  <p>Tom</p>