Change Status Bar Background Color in Swift 3

前端 未结 14 1603
挽巷
挽巷 2020-11-28 04:21

In XCode 7.3.x ill changed the background Color for my StatusBar with:

func setStatusBarBackgroundColor(color: UIColor) {
guard  let statusBar = UIApplicatio         


        
14条回答
  •  一向
    一向 (楼主)
    2020-11-28 04:59

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any] ?) -> Bool {
        // Override point for customization after application launch.
    
        UINavigationBar.appearance().barStyle = .blackOpaque
        return true
    }
    

    This works for me, as my navigation barTintColor was black and unable to see the status bar.

    When set above code it didFinishLaunch status bar appears in white.

提交回复
热议问题