SwiftUI the text color of destination from NavigationLink in List won't change when toggle darkmode

Viewed 17

The text of destination View of NavigationLink in List won't change its foreground color when uesr change appearance.

But the desitination View of the outside one works well.

See Video in https://oss.catrefuse.com/img/sample

sample code:

struct BugView: View {
  var body: some View {
    NavigationStack {
      VStack {
        List {
          NavigationLink("Link in List", destination:   Text("Link in List") )
            .tag(UUID())
        }
        Spacer()
        NavigationLink("Link outside", destination:   Text("Link outside") )
      }
    }
  }
}

in macOS Ventura 13.0 beta7 / iOS 16.0 / Xcode 14.0

  • update: I found that it seems to be a problem with the new NavigationStack in SwiftUI 3.0, which will go away as using the old NavigationView
0 Answers
Related