使用Xcode更改导航栏色调

Der*_*rek 6 tint uinavigationcontroller ios

我一直在寻找这个网站和其他如何设置导航栏色调变化,我已经看到的例子,但不是我需要的所以任何帮助将不胜感激.

在我的应用代表我有:

@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's root view controller and display.
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];


    return YES;
}
Run Code Online (Sandbox Code Playgroud)

当我self.navigationController.navigationBar setTintColor:[UIColor blackColor]在上面输入代码时,它只会改变我的一个导航控制器而不是我需要的那个.

我的tabbar上有7个项目,当我按下"MORE ..."时,我得到一个表格视图,其他项目不适合主屏幕,导航栏会自动添加,无论我做什么我无法更改此导航栏色调,我可以更改我拥有@synthesize但没有自动输入的那个.

有人可以告诉我如何更改自动放置的导航栏吗?

Nic*_*ood 17

您可以使用外观代理执行此操作.如果您设置这样的颜色,它将应用于应用程序中的每个导航栏:

[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
Run Code Online (Sandbox Code Playgroud)