Skip to content

Instantly share code, notes, and snippets.

@jlcampana
Created August 17, 2012 10:11
Show Gist options
  • Save jlcampana/3377690 to your computer and use it in GitHub Desktop.
Save jlcampana/3377690 to your computer and use it in GitHub Desktop.
Customize Navigation Bar
UINavigationBar *navBar = [[self navigationController] navigationBar];
//If we want a custom logo:
UIImage *backgroundImage = [UIImage imageNamed:@"background_im"];
[navBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
self.navigationItem.titleView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo_img"]] autorelease];
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
self.navigationController.navigationItem.backBarButtonItem.tintColor = [UIColor redColor];
self.navigationController.navigationBar.tintColor = [UIColor redColor];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor blackColor] forKey:UITextAttributeTextColor];
[[UIBarButtonItem appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor blackColor],UITextAttributeTextColor,
[UIColor whiteColor],UITextAttributeTextShadowColor,nil]forState:UIControlStateNormal];
self.navigationItem.title = @"title";
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
[self.navigationController setNavigationBarHidden:NO animated:YES];
@jlcampana
Copy link
Author

Textured Navigation Bar with image logo.
It changes the tint color too.

Code used in http://gotopic.iz3solutions.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment