1

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:

  1. Using Section with titles: Creates extra dividers before and after each section, separating the title from the picker options

  2. Using Text().disabled(true) as headers: Same issue - extra dividers appear

  3. Adding 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") } 

Reference screenshot

My menu

What is the correct way to structure multiple Pickers within a Menu to match this appearance without extra dividers around section headers?

New contributor
Anton Genkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.