Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine height of the toolbar in UINavigationController?

I have a view with a toolbar presented by a UINavigationController.

When I am handling UIKeyboardWillShowNotification, I'm scrolling the entire screen upwards by the height of the keyboard. The thing is when the keyboard is shown, the bottom toolbar is not, so I need to scroll the screen upwards by only (keyboard.height - toolbar.height).

But how to get the height of the toolbar?

Thanks

like image 792
Radek Skokan Avatar asked Jul 05 '12 13:07

Radek Skokan


People also ask

How do I change the navigation bar height in Swift 4?

In order to increase the height of the navbar , you have to increase the size of the children > li > a . Keep in mind that the children already have vertical padding of 15px.


1 Answers

You just should check the toolbar frame.

self.navigationController.toolbar.frame.size.height

Of course, it only works if you have a navigation controller...

like image 61
Martin Avatar answered Nov 13 '22 20:11

Martin