I am trying to change the font size of only one of my view controllers because it lends itself to more text, which requires a smaller font size than my other views. I set the navigation bar attributes in appdelegate during didFinishLaunchingWithOptions, and then set the font for my view controller in question during viewDidLoad. However, when I return to the screen or forward, the changes that I made in the navigation bar are saved, i.e. Smaller font. Is there any way around this? For example, if the font returns to normal after exiting the view, or something else?
Cliffsnotes: An attempt to install a font in only one view controller, but as soon as I installed it, it applies to all view controllers.
The 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 controller view 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]];