Custom height for UINavigationBar or alternative of UINavigationBar

青春壹個敷衍的年華 提交于 2019-12-13 12:32:32

问题


I have a viewController with navigation bar. I want to increase the height of navigation bar but I can't. I already search about increasing the height of navigation bar but not get any success.

Is there any to increase the height of navigation bar or any other lib/alternative?


回答1:


You can use your custom view as your navigation bar. Customize view as per your requirement and hide the default navigation bar as

[self.navigationController setNavigationBarHidden:YES];

You can give back action on the back button as

[self.navigationController popViewControllerAnimated:YES];

You can perform the same action on button as well as touch of UIView or UIImageView as per your need. Hope it helps. Happy Coding.. !!




回答2:


Directly changes are not permissible

... It is not permissible to change the navigation bar object or modify its bounds, frame, or alpha values directly... by developer.apple.com

But here are same questions and answers:

  1. Changing the height of the Navigation bar iOS Swift
  2. Change UINavigationBar Height



回答3:


The system's default height is 44.0f.

You can't change default height, but you can hide the navigation bar, then customize a view instead of system's navigation bar.



来源:https://stackoverflow.com/questions/35680853/custom-height-for-uinavigationbar-or-alternative-of-uinavigationbar

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