public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/*
in the place where you init the navigationController:
fixer = [[AENavigationControllerDelegate alloc] init];
navigationController.delegate = fixer;
*/
 
@interface AENavigationControllerDelegate : NSObject <UINavigationControllerDelegate>
 
@end
 
 
@implementation AENavigationControllerDelegate
 
#define bgImageTag 143
 
- (void)navigationController:(UINavigationController *)navigationController
didShowViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
UIImageView* imageView = (UIImageView*)[navigationController.navigationBar viewWithTag:bgImageTag];
if(!imageView)
{
UIImage *image = [UIImage imageNamed:@"header-logo-bg.png"];
imageView = [[UIImageView alloc] initWithImage:image];
imageView.tag = bgImageTag;
}
[navigationController.navigationBar insertSubview:imageView atIndex:0];
}
 
@end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.