3

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?

fuzzzlove
  • 183
  • 1
  • 6

1 Answers1

-1

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")
                }
            }
    }
}
sugimoto
  • 40
  • 1
  • 1