iOS 18 navigationBar color scheme not working

Hello, I'm encountering an issue with toolbarColorScheme in iOS 18. In a simple example, toolbarColorScheme works fine when triggered in onAppear. However, after navigating to a different view (e.g., following a link, such as link 234), and then returning, the toolbarColorScheme seems to be ignored. Could anyone help me resolve this issue?

struct TestNavigationBarColor: View {
    var body: some View {
        NavigationStack {
            List {
                Text("123")
                NavigationLink(value: 1) {
                    Text("234")
                }
            }
            .toolbarColorScheme(.dark, for: .navigationBar)
            .toolbarBackground(.visible, for: .navigationBar)
            .navigationTitle("Title1")
            
            .navigationDestination(for: Int.self) {_ in
                List {
                    Text("Nested screen")
                }
                .navigationTitle("Title2")
            }
        }
    }
}
Answered by Vision Pro Engineer in 805142022
Accepted Answer
iOS 18 navigationBar color scheme not working
 
 
Q