How to increase the height of the UINavigationBar?

A simple question: how to increase the height of the navigation bar so that additional widgets fit there, while maintaining blur?

Examples are the Calendar app, in which abbreviations for the day of the week are added at the bottom of the navigation bar ...

Calendar app

... and in Mail when moving mail to another folder:

Mail app

+4
source share
3 answers

Since iAnurag post ans is correct, but still has some ui problem (width doesn't fit)


You can resize by adding a category as shown below.

Project example
Download

the 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
enter image description here
When press on "Button" enter image description here


Problem in iAnurag Code
enter image description here
+5

UINavigationBar ThatFits.

@implementation UINavigationBar (customNav)
- (CGSize)sizeThatFits:(CGSize)size  
{
  CGSize newSize = CGSizeMake(self.frame.size.width,70);
  return newSize;
}
@end
0

All Articles