views:

171

answers:

1

Can someone tell me the pixel height of the iPhone navBar, when you turn the phone Horizontal?

I know this is a basic question but I cannot locate the answer.

Thank You.

+4  A: 

You shouldn't rely on hard coded values when dealing with UI sizing. Especially now that the [large-iPod-type-device] is on it's way.

You can get the height of the bar by querying its frame.

something along the lines of:

navigationController.navigationBar.frame.size.height;

will return the bar's height.

Jasarien
well my problem is that I am using a graphic to replace the navBar and it is distorted - how do you handle this, given that the new devices may not have the same dimensions?
Chris
you could wrap the graphic with a UIView that resizes properly then center the graphic within the UIView. That way it won't be distorted. Just make sure you get the UIView's autoresizingMask properly.
Hua-Ying