2016-09-14 54 views
-1

設置UINavigationBar.appearance().tintColordidFinishLaunchingWithOptions用於在整個應用程序中更改tintColor。在iOS 10上,情況並非如此。全局更改UINavigationBar欄色調

private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 
    // Set tint color 
    UINavigationBar.appearance().tintColor = UIColor.black 

    return true 
} 

如何更改導航欄的色調顏色?

回答

2

問題是您的didFinishLaunchingWithOptions方法。它已在iOS 10中更改。

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool 
+0

完美。謝謝。這是否會在以前的iOS版本上運行? –

+0

@DanielStorm我這麼認爲。否則,沒有更新的應用程序會再次在舊版本上工作 – FelixSFD