Skip to content

Instantly share code, notes, and snippets.

@ushu
Created August 13, 2013 12:24
Show Gist options
  • Save ushu/6220584 to your computer and use it in GitHub Desktop.
Save ushu/6220584 to your computer and use it in GitHub Desktop.
Increase the height of the UINavigationBar
#import <UIKit/UIKit.h>
@interface BigNavBar : UINavigationBar
@end
#import "BigNavBar.h"
@implementation BigNavBar
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
// here we set the offset for the topItem
[self setTitleVerticalPositionAdjustment:-23 forBarMetrics:UIBarMetricsDefault];
}
return self;
}
-(CGSize)sizeThatFits:(CGSize)size {
// here we give the frame "after layout of subviews", ie the very frame with height = 94
return CGSizeMake(320, 94);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment