Instance Method インスタンスメソッド

menuStyle(_:)

Sets the style for menus within this view.

Declaration 宣言

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())