Skip to content

Instantly share code, notes, and snippets.

@Amosel
Created August 31, 2011 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Amosel/1184147 to your computer and use it in GitHub Desktop.
Save Amosel/1184147 to your computer and use it in GitHub Desktop.
/*
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment