I have a tab bar whose icons I am trying to make white, however despite the fact that I am specifying the color, the icons remain grey for some reasons (despite me never actually setting them to grey).
The code is shown below -
struct tabViewUnique: View {
init() {
let appearance = UITabBarAppearance()
appearance.backgroundColor = UIColor(Color(#colorLiteral(red: 0.7137255072593689, green: 0.10196077823638916, blue: 0.10196077823638916, alpha: 1)))
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
UITabBar.appearance().unselectedItemTintColor = UIColor.white
}
var body: some View {
TabView() {
temp()
.tabItem {
Image(systemName: "globe.americas.fill")
}
Text("Tab 2")
.tabItem {
Image(systemName: "bag")
}
Text("Tab 2")
.tabItem {
Image(systemName: "plus.square")
}
Text("Tab 2")
.tabItem {
Image(systemName: "person")
}
}.accentColor(.white)
}
}