AFAIK, swiftUI TabView doesn’t present a lot management such as you can not change background colour as there is no such thing as a direct public api. Because it internally use UIKIt Tabbar which itself permits to alter icon and textual content colour solely.
I might advocate you to create your personal customTabView which may be very easy to create for e.g. under and this additionally animate whereas you choose the tabs
struct CustomTabView: View {
@State personal var selectedTab: Tab = .as we speak
@Namespace personal var namespace
var physique: some View {
VStack {
Spacer()
// Overlay Tab Bar
HStack {
tabItem(icon: "sparkles", title: "Chat", tab: .chat)
tabItem(icon: "calendar", title: "At present", tab: .as we speak)
tabItem(icon: "checklist.bullet", title: "Critiques", tab: .opinions)
tabItem(icon: "sq..stack", title: "Area", tab: .area)
}
.padding(8)
.background(
RoundedRectangle(cornerRadius: 30)
.fill(Coloration(.systemGray6))
)
.padding(.horizontal, 16)
.padding(.backside, 10)
}
}
@ViewBuilder
personal func tabItem(icon: String, title: String, tab: Tab) -> some View {
Button {
withAnimation(.easeInOut(length: 0.25)) {
selectedTab = tab
}
} label: {
VStack(spacing: 4) {
Picture(systemName: icon)
.font(.system(dimension: 18, weight: .medium))
Textual content(title)
.font(.system(dimension: 12))
}
.foregroundColor(selectedTab == tab ? .black : .grey)
.body(maxWidth: .infinity)
.padding(.vertical, 10)
.background(
ZStack {
if selectedTab == tab {
RoundedRectangle(cornerRadius: 20)
.fill(Coloration.inexperienced.opacity(0.3)) // your spotlight colour
.matchedGeometryEffect(id: "customBg", in: namespace)
}
}
)
}
}
}
You may replace your required colour accordingly!

