全局更改UINavigationBar条纹色彩

时间:2016-09-14 15:22:46

标签: ios swift uinavigationbar swift3 ios10

UINavigationBar.appearance().tintColor中设置didFinishLaunchingWithOptions,用于更改整个应用中的tintColor。在iOS 10上,情况已经不是这样了。

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

    return true
}

如何更改导航栏色调颜色?

1 个答案:

答案 0 :(得分:2)

问题是你的didFinishLaunchingWithOptions方法。在iOS 10中进行了更改。

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