menuStyle(_:)
Sets the style for menus within this view.
Declaration
nonisolated func menuStyle<S>(_ style: S) -> some View where S : MenuStyle
Discussion
To set a specific style for all menu instances within a view, use the menuStyle(_:) modifier:
Menu("PDF") {
Button("Open in Preview", action: openInPreview)
Button("Save as PDF", action: saveAsPDF)
}
.menuStyle(ButtonMenuStyle())