How to fix gray bar under List in NavigationView in TabView? How to fix gray bar under List in NavigationView in TabView? xcode xcode

How to fix gray bar under List in NavigationView in TabView?


I see there are many NavigationView in the stack:

 VStack{             NavigationView{ // << here in first snapshot                VStack{

and

        NavigationView{ // << here in second snapshot            ZStack{

and as there no complete code provided there are possible others as well...

Here is a thumb-rule: there must be only one root NavigationView in one view hierarchy chain. So make sure you place one NavigationView as tab-item root view of Past Journals tab (again, assumption based only on provided code).


Setting UITabBar.appearance().isTranslucent to false will break constraints that NavigationView is relying on.

To fix this, replace these lines of code:

UITabBar.appearance().isTranslucent = falseUITabBar.appearance().barTintColor = UIColor.black

With these:

let tabBarAppearance = UITabBarAppearance()tabBarAppearance.configureWithOpaqueBackground()tabBarAppearance.backgroundColor = UIColor.blackUITabBar.appearance().standardAppearance = tabBarAppearance