Change the hue of the navigation bar with Xcode

I looked at this site, and on others, how to set up a change in the hue of navigation, I saw examples, but not quite what I needed, so any help would be appreciated.

my application delegate I have:

@synthesize window; @synthesize tabBarController; @synthesize navigationController; @synthesize navigationController1; @synthesize navigationController2; @synthesize viewController; @synthesize viewController2; @synthesize viewController3; #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { // Override point for customization after application launch. // Set the tab bar controller as the window root view controller and display. self.window.rootViewController = self.tabBarController; [self.window makeKeyAndVisible]; return YES; } 

When I enter the code self.navigationController.navigationBar setTintColor:[UIColor blackColor] as above, it changes only one of my navigation controllers, but not the one I need.

I have 7 elements in my tab, and when I click "MORE ...", I get a table view with other elements that do not fit on the main screen, the navigation bar is added automatically, and no matter what I can’t change this shade of the navigation bar, I can change the ones that I have @synthesize , but not automatically entered.

Can someone please let me know how to change the automatically placed navigation bar?

+6
source share
2 answers

You can do this using an appearance proxy. If you set this color, this applies to every navigation bar in the application:

 [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; 
+17
source

For iOS 6 and below:

 [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; 

For iOS 7 and above:

 [[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]]; 

Set this method to AppDelegate.

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
+3
source

Source: https://habr.com/ru/post/907686/


All Articles