Home > Software engineering >  Tab & Navigation Bar changes after upgrading to XCode 13 (& iOS 15)
Tab & Navigation Bar changes after upgrading to XCode 13 (& iOS 15)

Time:09-23

I have an iOS app, since upgrading to XCode 13, i have noticed some peculiar changes to Tab and Navigation bars. In XCode 13, there's now this black area on the tab and nav bars and on launching the app, the tab bar is now black as well as the navigation bar. Weird enough, if the view has a scroll or tableview, if i scroll up, the bottom tab bar regains its white color and if i scroll down, the navigation bar regains its white color.

N:B: I already forced light theme from iOS 13 and above:

 if #available(iOS 13.0, *) {
     window!.overrideUserInterfaceStyle = .light
 }

Can anyone assist or point me in the right direction so as to deal with this peculiarity.

Is there a simple fix to get Storyboard to readjust or this is a case where i have to make changes to each View manually?

Example of Storyboard before upgrade:

enter image description here

and after:

enter image description here

Simulator screen before & after (respectively) upgrade:

enter image description here

CodePudding user response:

first of all the problem is cause by unchecking translucent I fixed it by choosing navigation bar appearance from attributes inspector scroll edge it will fix it see this screen shot please

CodePudding user response:

About Navigation Bar is black, try do it:

let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .red
appearance.titleTextAttributes = [.font: 
UIFont.boldSystemFont(ofSize: 20.0),
                              .foregroundColor: UIColor.white]

// Customizing our navigation bar
navigationController?.navigationBar.tintColor = .white
navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance

I wrote a new article talking about it.

https://medium.com/@eduardosanti/uinavigationbar-is-black-on-ios-15-44e7852ea6f7

  • Related