Home > Mobile >  Swift ui create buttons in xcode style
Swift ui create buttons in xcode style

Time:03-28

enter image description here

How do I make a button like the blue one shown in the image?

Button("Done") {
}

enter image description here

CodePudding user response:

It is a default style button and is managed by keyboard shortcut, like

var body: some View {
    HStack {
        Button("Done") {}
        Button("Clone") {}
            .keyboardShortcut(.defaultAction) // << here !!
    }
}

demo

  • Related