I'm using UITabBarAppearance to customize my TabBar in a SwiftUI app. The customization works perfectly on iOS 18 and earlier, but after updating to iOS 26, the unselected tab items no longer respect my color settings - they just appear black (they are on a white background).Here's my simplified setup:
struct ContentView: View {
var body: some View {
TabView {
Text("Home")
.tabItem {
Image(systemName: "house")
Text("Home")
}
.tag(0)
Text("Settings")
.tabItem {
Image(systemName: "gear")
Text("Settings")
}
.tag(1)
}
.onAppear {
setupTabBarAppearance()
}
}
private func setupTabBarAppearance() {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
let itemAppearance = UITabBarItemAppearance()
// These settings work for selected items
itemAppearance.selected.iconColor = .systemBlue
itemAppearance.selected.titleTextAttributes = [
.font: UIFont.systemFont(ofSize: 10),
.foregroundColor: UIColor.systemBlue
]
// These settings STOPPED working on iOS 26 for unselected items
itemAppearance.normal.iconColor = .gray
itemAppearance.normal.titleTextAttributes = [
.font: UIFont.systemFont(ofSize: 10),
.foregroundColor: UIColor.gray
]
appearance.stackedLayoutAppearance = itemAppearance
appearance.inlineLayoutAppearance = itemAppearance
appearance.compactInlineLayoutAppearance = itemAppearance
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}
}