Hi,
I have a TabView where I simply display to views.
TabView {
TeamsListView()
.tabItem {
Image(systemName: "person.3")
Text("Teams")
}
GamePlanView()
.tabItem {
Image(systemName: "calendar")
Text("Game Plan")
}
}
In the first view, the background of the tabbar is correct (set in init function)
init() {
let appearance = UITabBarAppearance()
appearance.configureWithTransparentBackground()
appearance.backgroundColor = UIColor(.black.opacity(0.5))
appearance.stackedLayoutAppearance.normal.iconColor = .white
appearance.stackedLayoutAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
appearance.stackedLayoutAppearance.selected.iconColor = UIColor(Color.accentColor)
appearance.stackedLayoutAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor(Color.accentColor)]
UITabBar.appearance().standardAppearance = appearance
}
this looks as the following:
but when I change to GamePlanView, the background disappears. When I switch back to the TeamsListView, the background is like in the picture above.
Does anyone have any hints or is this maybe a known issue?