How to determine height of the toolbar in UINavigationController?

杀马特。学长 韩版系。学妹 提交于 2021-02-07 05:27:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!