iOS/Swift 오류 찾아 삼만시간

Bartintcolor iOS13이상

Chafle 2022. 11. 8. 17:54
반응형

Appdelegate에서

 

if #available(iOS 13.0, *) {

            let navBarAppearance = UINavigationBarAppearance()

            navBarAppearance.configureWithOpaqueBackground()

            navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]

            navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]

            navBarAppearance.backgroundColor = UIColor(displayP3Red: 47 / 255, green: 54 / 255, blue: 64 / 255, alpha: 1.0)

            UINavigationBar.appearance().standardAppearance = navBarAppearance

            UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance

        } else {

            UINavigationBar.appearance().barTintColor = UIColor(displayP3Red: 47 / 255, green: 54 / 255, blue: 64 / 255, alpha: 1.0)

            UINavigationBar.appearance().largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]

            UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]

        }

반응형