I've observed a difference in the layout of menu items within ContextMenu
and Menu
when comparing system applications to my own SwiftUI app, specifically concerning the order of icons and titles.
On iOS 26, system apps (as shown in the image in the "System App" column) appear to display the item's icon before its title for certain menu items. However, in my SwiftUI app, when I use a Label
(e.g. Label("Paste", systemImage: "doc.on.clipboard")
) or an HStack
containing an Image
and Text
, the icon consistently appears after the title within both ContextMenu
and Menu
items.
I'm aiming to achieve the "icon first, then title" layout as seen in system apps. My attempts to arrange this order using HStack
directly within the Button
's label
closure:
Menu {
Button { /* ... */ } label: {
HStack {
Image(systemName: "doc.on.clipboard")
Text(String(localized: "Paste"))
}
}
// ...
} label: {
Text("タップミー")
}
seem to be overridden or restricted by the OS, which forces the icon to the leading position (as shown in the image in the "Custom App" column).
System App | Custom App |
Is there a specific SwiftUI modifier, or any other setting I might have overlooked that allows developers to control the icon/title order within ContextMenu
or Menu
items to match the system's behavior? Or is this a system-controlled layout that app developers currently cannot customize, and we need to wait for potential changes from Apple to expose this capability for in-app menus?
Thanks in advance!