Created
June 15, 2012 13:15
-
-
Save jeksys/2936420 to your computer and use it in GitHub Desktop.
custom UINavigationBar
This file contains 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
UIImage *backgroundImage = [UIImage imageNamed:@"UI_navbar.png"]; | |
[[UINavigationBar appearance] setBackgroundImage:backgroundImage | |
forBarMetrics:UIBarMetricsDefault]; | |
UIImage *backButton = [[UIImage imageNamed:@"UI_backbutton.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0,0,0,0)]; | |
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateNormal | |
barMetrics:UIBarMetricsDefault]; | |
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateHighlighted | |
barMetrics:UIBarMetricsDefault]; | |
[[UINavigationBar appearance] setTitleTextAttributes: | |
[NSDictionary dictionaryWithObjectsAndKeys: | |
[UIColor clearColor], UITextAttributeTextColor, | |
[UIColor clearColor], UITextAttributeTextShadowColor, | |
[NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset, | |
[UIFont fontWithName:@"Verdana-Bold" size:16], UITextAttributeFont, | |
nil]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment