Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 导航栏着色颜色更改_Ios_Swift_Uinavigationbar_Tintcolor - Fatal编程技术网

Ios 导航栏着色颜色更改

Ios 导航栏着色颜色更改,ios,swift,uinavigationbar,tintcolor,Ios,Swift,Uinavigationbar,Tintcolor,我有一个设置了色调颜色的导航栏,但当我导航到其他屏幕时,它看起来与上一个屏幕有点不同..知道为什么会这样吗..如何修复此问题将此代码添加到rootViewController [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]}]; override func viewWillAppear(_ animated:

我有一个设置了色调颜色的导航栏,但当我导航到其他屏幕时,它看起来与上一个屏幕有点不同..知道为什么会这样吗..如何修复此问题将此代码添加到
rootViewController

[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
 override func viewWillAppear(_ animated: Bool) {
        navigationController?.navigationBar.barStyle = UIBarStyle.default
        navigationController?.navigationBar.tintColor = UIColor.black
    }

如果对项目中的所有ViewController使用相同的导航控制器,则需要在AppDelegate中设置色调颜色

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        UINavigationBar.appearance().barTintColor = colorToSet 
// colorToSet is an object of UIColor 
        return true
    }

在故事板中选择导航栏并更改栏的颜色

在带有红色标记的图像显示中


检查该特定视图控制器上的导航控制器的色调是否有任何变化。其他视图控制器的背景是否较亮?添加导航栏颜色变化代码。如果可能的话,附上两个屏幕的图像