Simple question: How can I increase the height of the navigation bar so that additional widgets will fit in there while keeping the blur?
Examples are the Calendar app where weekday abbreviations are added to the bottom of the navigation bar...
...and in Mail when you move the mail to a different folder:
Personally I feel most comfortable using a navbar height of 64px. It is enough height to accommodate a logo, and there is room enough to use text in combination with symbols.
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.
As iAnurag post ans is correct but still have some ui problem (Width is not proper)
Code
#import "ViewController.h"
@implementation UINavigationBar (customNav)
- (CGSize)sizeThatFits:(CGSize)size {
CGRect rec = self.frame;
CGRect screenRect = [[UIScreen mainScreen] bounds];
rec.size.width = screenRect.size.width;
rec.size.height = 70;
return rec.size;
}
@end
Output
When press on "Button"
https://developer.apple.com/library/prerelease/content/samplecode/NavBar/Introduction/Intro.html
From ReadMe.md:
Extended Navigation Bar #### This example demonstrates placing a custom view underneath the navigation bar in such a manner that viewappears to be part of the navigation bar itself. This technique may be used to create an interface similar to the iOS Calendar app.
My not humble opinion: Don't override sizeThatFits(_:)
, don't set constraints on nav bar height. Just do the illusion from example above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With