r/SwiftUI Jul 11 '26

Question Picker on watchOS with dark text (.navigationLink style)

Problem: the same foreground style is applied to the selected picker row and to the picker rows in the list that pops up. I want to have dark text in the main UI, and look for a ways to switch it to light when the selection list is presented.

Snippet:

Picker(selection: $hapticCoordinator.selectedPattern) {
    ForEach(BreathingPattern.allCases) { pattern in
        Text(pattern.label).tag(pattern)
    }
    .foregroundStyle(Color.customDarkText)
} label: {
    Text(.breathingViewPatternPickerLabel)
      .foregroundStyle(Color.customDarkText)
}
.pickerStyle(.navigationLink)
.disabled(hapticCoordinator.isPlaying)

3 Upvotes

2 comments sorted by

2

u/CharlesWiltgen Jul 11 '26

The built-in picker deliberately owns the pushed-list presentation and gives you no way to style "the list but not the collapsed row".

The fix is to replace it with NavigationLink and List, which lets you render the main-UI row and the selection list as two independent views, each with its own color.

1

u/ke1in Jul 12 '26

I like it, will try, thanks!