On macOS 26.3, Xcode 26.3, why does a labelStyle of titleAndIcon not show both the title and the icon of a label?
The label styles iconOnly and titleOnly behave as expected.
Picker("Label Demo", selection: $selectedItem) {
Label {
Text("File")
} icon: {
Image(systemName: "doc")
}
Label {
Text("Folder")
} icon: {
Image(systemName: "folder")
}
}
.labelStyle(.titleAndIcon)
.pickerStyle(.segmented)
Note that there is no icon shown. Placing the .labelStyle modifier in different places has no effect.
The icon is correctly shown when the labelStyle is set to .iconOnly.
An NSSegmentedControl created with AppKit and presented in an NSViewRepresentable does correctly show titles and icons if configured appropriately.
Tested on:
- macOS 26.3 (25D125)
- Xcode 26.3 (17C519)
- A brand new SwiftUI "macOS App" project.
Hello @kennyc,
Displaying the title and icon within a segmented control is currently not supported for SwiftUI's .segmentedPickerStyle.
If you'd like us to consider adding the necessary functionality for this, please file an enhancement request using Feedback Assistant and reply with FB number here once complete.
Consider also, the Human Interface Guidelines recommends using either text or an image in a single segmented control, not a mix. You can review the Segmented controls section of the guidelines for more best practices.
Travis Trotto - DTS Engineer