I've tried this to try to change the color of the tab icons individually, but for some reason, the color will modify it correctly and then after tapping back to the icon, it will not display the customized color.
How would I go about changing the tab items icons for each individual tab (different colors for each)?
Here's the code for the view holding the TabView
that I'm trying to modify.
struct MainView: View {
@AppStorage("PendingOnboarding") var pendingOnboarding = true
init() {
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(Color.recyclepediaGreen)
}
var body: some View {
NavigationView {
ZStack {
TabView {
CurbsideView()
.tabItem {
Label("Curbside", systemImage: "car.fill")
}
ItemsView()
.tabItem {
Label("Items", systemImage: "archivebox.fill")
}
LearnView()
.tabItem {
Label("Learn", systemImage: "info.circle.fill")
}
ContactUsView()
.tabItem {
Label("Contact Us", systemImage: "phone.fill.connection")
}
}
.accentColor(Color.recyclepediaBlue)
.toolbar {
ToolbarItem(placement: .principal) {
Image("Recyclepedia")
.resizable()
.scaledToFit()
.padding(.top, 5)
.padding(.bottom, 5)
}
}
}
.popup(isPresented: $pendingOnboarding, dragToDismiss: false, closeOnTap: false, backgroundColor: Color.white) {
OnboardingView(pendingOnboarding: $pendingOnboarding)
}
}
}
}