Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 632
ChrisP Avatar asked Apr 25 '11 18:04

ChrisP


People also ask

How do I use the navigation bar in Xcode?

Start with Navigation ControllerCreate a single view application in Xcode. Add two view controller into your storyboard. Create two different swift files for those view controllers and set identifiers for them. Take a button in each view controller, set constrain for them and customize as you want.


1 Answers

Not sure if this is what you need.

self.navigationController.navigationBar.frame.size.height

like image 132
AbeEstrada Avatar answered Sep 21 '22 08:09

AbeEstrada