5

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 Answer 1

0

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")
                }
            }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.