I'm trying to change the font size of just one of my view controllers because it lends itself to more text, thus requiring smaller font size than my other views. I am setting the navigation bar attributes in the appdelegate during didFinishLaunchingWithOptions, and then setting the font for my view controller in question during the viewDidLoad. However, when I go back a screen, or forward, the changes I made to the navigation bar are retained, i.e. the smaller font. Is there a way around this? For example setting the font back to normal upon exiting the view or something?
Cliffsnotes: Trying to set font in just one view controller, but once I set it, it applies to all view controllers.
Code is as follows:
In AppDelegate:
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar.png"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor clearColor],
UITextAttributeTextColor,
[UIColor whiteColor],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"QuicksandBold-Regular" size:24.0],
UITextAttributeFont,
nil]];
In the view controller viewDidLoad:
[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor clearColor],
UITextAttributeTextColor,
[UIColor whiteColor],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"QuicksandBold-Regular" size:18.0],
UITextAttributeFont,
nil]];