0

I try to change the color of the TabView bottom bar in swiftUI so far with no success

the code I got is

struct ContentView: View {
    var body: some View {
        TabView {
            Text("First View")
                .tabItem {
                    Image(systemName: "house.fill")
                    Text("Home")
                }
            
            Text("Second View")
                .tabItem {
                    Image(systemName: "person.fill")
                    Text("Profile")
                }
            
            Text("Third View")
                .tabItem {
                    Image(systemName: "gearshape.fill")
                    Text("Settings")
                }
        }
        .accentColor(Color.blue) // set the background color to blue
    }
}

I tried .accenColor and .background but both didn't change anything. How can I change the background color of the tabview navigation bar?

Rob
  • 14,746
  • 28
  • 47
  • 65
Cruder
  • 29
  • 5

0 Answers0