问题
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
回答1:
You just should check the toolbar frame.
self.navigationController.toolbar.frame.size.height
Of course, it only works if you have a navigation controller...
来源:https://stackoverflow.com/questions/11345260/how-to-determine-height-of-the-toolbar-in-uinavigationcontroller