How to increase the icon button of Menu in MacOS App SwiftUI?

1.1k Views Asked by At

I want to increase the icon button of the Menu in SwiftUI for a macOS app, but modifiers such as .imageScale(.large), .resizable(), .scaleEffect(1.2), and changing font doesn't work. image

Menu {
    Button("Quit") {}
} label: {
    Image(systemName: "gear")
        .font(.title)
        .resizable()
        .scaleEffect(1.2)
        .imageScale(.large)
}
.menuStyle(.borderlessButton)
.menuIndicator(.hidden)

How can I change icon size?

1

There are 1 best solutions below

0
sugimoto On BEST ANSWER

Use ImageinText.

struct DetailView: View {
    var body: some View {
        Text("hello")
            .contextMenu {
                Button(action: { }) {
                    Text(Image(systemName: "gear"))
                        .font(.largeTitle)
                }
                
                Button(action: { }) {
                    Image(systemName: "gear")
                }
            }
    }
}