Steve Forsyth
Steve Forsyth

Reputation: 21

iOS 5 IB shows nav bar as 44 pixels rather than 32 pixels high in landscape mode

in latest xcode, when I set a UIView to landscape mode, the nav bar is still showing as 44 pixels high instead of 32.

When I run it, it is correct at 32 pixels high. The main problem is that I build the UI with a background and I use the background to place the image buttons in their proper place. But that is not possible to do without a bit of trial and error and it makes it impossible to see what it will actually look like in IB because the background is then resized to the 44 pixel nav bar height vs 32. This seems like a bug in xcode as I don't see any way to set/reset the height.

Anyone else have this problem and if so, do you know how to fix it?

Upvotes: 1

Views: 673

Answers (1)

pedrouan
pedrouan

Reputation: 12910

The problem is that ios places the 44px image in the landscape view. You have to write stk like this:

UIImage *backgroundImageLandscape = [UIImage imageNamed:@"imageForLandscape"];
[navBar setBackgroundImage:backgroundImageLandscape forBarMetrics:UIBarMetricsLandscapePhone];

Upvotes: 4

Related Questions