I created my own subclass of UINavigationBar in order to enable custom background that is taller than 44pxs.
I did it by overriding these two methods:
-(
To solve the push/pop issue use setTitleVerticalPositionAdjustment in sizeThatFits:(CGSize)size
- (CGSize)sizeThatFits:(CGSize)size {
UIImage *img = [UIImage imageNamed:@"navigation_background.png"];
[self setTitleVerticalPositionAdjustment:-7 forBarMetrics:UIBarMetricsDefault];
CGRect frame = [UIScreen mainScreen].applicationFrame;
CGSize newSize = CGSizeMake(frame.size.width , img.size.height);
return newSize;
}
Try to override layoutSubviews
: call [super layoutSubviews]
inside and then reposition the items.