I'm trying to create a SwiftUI Menu containing two Picker to control content and sort. However, I cannot replicate menu appearance shown in my reference screenshot.
No matter which approach I try, I get unwanted extra dividers or incorrect text styling:
Using
Sectionwith titles: Creates extra dividers before and after each section, separating the title from the picker optionsUsing
Text().disabled(true)as headers: Same issue - extra dividers appearAdding disabled text as first picker item: The text still renders as an active/selectable item instead of a disabled header
I want to achieve the clean appearance shown in the reference screenshot, where section headers appear inside a picker.
Current Code:
swift
Menu { Text("Content") .foregroundStyle(.secondary) .disabled(true) contentPicker Divider() Text("Sort direction") .foregroundStyle(.secondary) .disabled(true) sortDirectionPicker } label: { Image(systemName: allFiltersEnabled ? "line.3.horizontal.decrease.circle" : "line.3.horizontal.decrease.circle.fill") } What is the correct way to structure multiple Pickers within a Menu to match this appearance without extra dividers around section headers?