问题
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:
- Changing the height of the Navigation bar iOS Swift
- 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