How do I obtain the height of UINavigationBar.navigationItem programmatically?

ChrisP picture ChrisP · Apr 25, 2011 · Viewed 24.5k times · Source

I am creating a custom UIToolbar to use as a UIView in the UINavigationBar.navigationitem.titleView property. I would like to size the toolbar height to that of the .navigationitem by obtaining the current height of the .navigationitem rather than hard code it. Is there a way to obtain the height value?

Answer

AbeEstrada picture AbeEstrada · May 1, 2012

Not sure if this is what you need.

self.navigationController.navigationBar.frame.size.height