gpt4 book ai didi

ios - 使用 Xcode 更改导航栏色调

转载 作者:可可西里 更新时间:2023-11-01 03:36:36 27 4
gpt4 key购买 nike

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

在我的 app delegate 上我有:

@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;
}

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

我的标签栏上有 7 个项目,当我按“更多...”时,我得到一个表格 View ,其中包含其他不适合主屏幕的项目,导航栏会自动添加,无论怎样我可以 我无法更改此导航栏色调,我可以更改我拥有的那些 @synthesize 但不能更改自动输入的。

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

最佳答案

您可以使用外观代理来做到这一点。如果您像这样设置颜色,它将应用于应用程序中的每个导航栏:

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

关于ios - 使用 Xcode 更改导航栏色调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9147830/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com