From 8af0309580986630f98005024b936e8504afb7fe Mon Sep 17 00:00:00 2001 From: Sven Date: Thu, 23 Apr 2026 13:45:00 +0200 Subject: [PATCH] Fix #36: Tab-Bar-Flicker in dunklen Themes behoben MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit toolbarBackground/toolbarColorScheme von jedem einzelnen Tab auf das TabView selbst verschoben. Per-Tab-Modifikatoren verursachten beim Tab-Wechsel ein weißes Aufblitzen, da die Styles nur für den jeweils aktiven Tab galten und beim Wechsel kurz verloren gingen. Co-Authored-By: Claude Sonnet 4.6 --- nahbar/nahbar/ContentView.swift | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/nahbar/nahbar/ContentView.swift b/nahbar/nahbar/ContentView.swift index 453f8e1..bbeb2db 100644 --- a/nahbar/nahbar/ContentView.swift +++ b/nahbar/nahbar/ContentView.swift @@ -38,32 +38,25 @@ struct ContentView: View { TabView(selection: $selectedTab) { TodayView() .tabItem { Label("Heute", systemImage: "sun.max") } - .toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar) - .toolbarBackground(.visible, for: .tabBar) - .toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar) .tag(0) PeopleListView() .tabItem { Label("Menschen", systemImage: "person.2") } - .toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar) - .toolbarBackground(.visible, for: .tabBar) - .toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar) .tag(1) IchView() .tabItem { Label("Ich", systemImage: "person.circle") } - .toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar) - .toolbarBackground(.visible, for: .tabBar) - .toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar) .tag(2) SettingsView() .tabItem { Label("Einstellungen", systemImage: "gearshape") } - .toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar) - .toolbarBackground(.visible, for: .tabBar) - .toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar) .tag(3) } + // Tab-Bar-Styling einmalig auf TabView statt auf jedem Tab setzen – + // verhindert weißes Aufblitzen beim Tab-Wechsel (Issue #36) + .toolbarBackground(theme.backgroundPrimary.opacity(0.92), for: .tabBar) + .toolbarBackground(.visible, for: .tabBar) + .toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar) .fullScreenCover(isPresented: $showingNahbarOnboarding) { OnboardingContainerView { nahbarOnboardingDone = true