0

since I updated Xcode to version 11/my device to iOS 13 my navigation bar background color changed to black when using large titles: large titles

The curious thing is that this does not happen with regular titles: regular titles

I already forced light mode (as I did not updated my assets for dark mode yet) and checked all the interface options available. When setting the navigation bar background color to white, the status bar still stays black - what am I doing wrong here? settings

Thanks in advance for your help.

1 Answers1

2

In iOS 13 and later, a large title navigation bar doesn’t include a background material or shadow by default. Also, a large title transitions to a standard title as people begin scrolling the content

if #available(iOS 13.0, *) {
    let appearance = UINavigationBarAppearance()
    appearance.backgroundColor = .purple
    appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
    appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]

    UINavigationBar.appearance().tintColor = .white
    UINavigationBar.appearance().standardAppearance = appearance
    UINavigationBar.appearance().compactAppearance = appearance
    UINavigationBar.appearance().scrollEdgeAppearance = appearance
} else {
    UINavigationBar.appearance().tintColor = .white
    UINavigationBar.appearance().barTintColor = .purple
    UINavigationBar.appearance().isTranslucent = false
}

Also you can refer below solution

In iOS13 the status bar background colour is different from the navigation bar in large text mode

Darshan
  • 2,272
  • 3
  • 31
  • 43
  • 1
    Tried this already, unfortunately it removes all the customizations I made regrading the navigationbar/-title in storyboard (colors, fonts, offsets..). Isn't there any easy way to solve that in storyboard? – bastianfischer Oct 09 '19 at 13:22