Customize default navigation bar appearance
suggest changeKNGRed and KNGGray are app-specific colors. fontWithName:size: returns nil when that font is not installed, and a nil font is ignored in the attributes dictionary. Set this appearance before the bar is created, typically in application:didFinishLaunchingWithOptions:.
// Default UINavigationBar appearance throughout the app
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor],
NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:17],
}];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
[[UINavigationBar appearance] setBarTintColor:[UIColor KNGRed]];
[[UINavigationBar appearance] setTranslucent:NO];
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];
[[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setTintColor:[UIColor KNGGray]];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents