Last active
July 30, 2022 13:06
-
-
Save kenmaready/c61a801b677eede59f28029c8fe3f68d to your computer and use it in GitHub Desktop.
Change color of nav bar and status bar inside viewDidLoad in iOS Apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside viewDidLoad() or wherever you set appearance of your navigation bar: | |
let appearance = UINavigationBarAppearance() | |
appearance.configureWithTransparentBackground() | |
appearance.backgroundColor = UIColor.systemBlue | |
appearance.titleTextAttributes = [.foregroundColor: UIColor.white] | |
navigationItem.standardAppearance = appearance | |
navigationItem.scrollEdgeAppearance = appearance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment