Created
August 17, 2012 10:11
-
-
Save jlcampana/3377690 to your computer and use it in GitHub Desktop.
Customize Navigation Bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Textured Navigation Bar with image logo.
It changes the tint color too.
Code used in http://gotopic.iz3solutions.com/