Jake Sankey
Jake Sankey

Reputation: 5137

Navigation Bar Height

I have a view that I whipped up in Interface Builder which has some content and a nav bar at the top. Typically throughout the iPhone UI, when the device is rotated to landscape, the nav bars get slightly shorter (in height). However, mine stays the same when rotated in any orientation. Is this some quirk about doing it through IB or am I missing a property somewhere? Thanks!

Upvotes: 2

Views: 1971

Answers (2)

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

Your problem is the autoresizingMask of the UINavigationBar that you've added via IB. You need to change it but IB unfortunately (maybe a bug) doesn't allow us to add the UIViewAutoresizingFlexibleHeight option. So you will need to do it programmatically,

navBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;

Upvotes: 6

WrightsCS
WrightsCS

Reputation: 50707

Typically, a UIToolbar will stay the same size. If your viewController is of UINavigationController class, the height of the bar should conform to rotation.

Upvotes: 0

Related Questions