This will work for iOS 16 and above. NOTE the Group container around your tab items and how these modifiers are on it, not the TabView.
var body: some View {
TabView {
Group {
FavoritesView()
.tabItem {
Label("Favorites", systemImage: "heart")
}
IslandsView()
.tabItem {
Label("Rivers", systemImage: "water.waves")
}
}
.toolbarBackground(.blue, for: .tabBar)
.toolbarBackground(.visible, for: .tabBar)
.toolbarColorScheme(.dark, for: .tabBar)
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: