Created
December 19, 2013 20:20
-
-
Save oliverbarreto/8045581 to your computer and use it in GitHub Desktop.
Changing the Font of Navigation Bar Title
You can customize the text style by using the “titleTextAttributes” properties of the navigation bar. You can specify the font, text color, text shadow color, and text shadow offset for the title in the text attributes dictionary, using the following text attribute keys: UITextAttributeFont – Key to the …
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
| NSShadow *shadow = [[NSShadow alloc] init]; | |
| shadow.shadowColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8]; | |
| shadow.shadowOffset = CGSizeMake(0, 1); | |
| [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: | |
| [UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0], NSForegroundColorAttributeName, | |
| shadow, NSShadowAttributeName, | |
| [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:21.0], NSFontAttributeName, nil]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment