I am trying to add style to the button but after adding style my text on button stops showing in XCode preview.
Button {
} label: {
Text("[email protected]")
}.buttonStyle(.borderedProminent).tint( .primary)
I also try
Button {
} label: {
Text("[email protected]")
}.buttonStyle(.borderedProminent).tint( .mint)
CodePudding user response:
It is because of the email address, a link will be detected. To achieve the desired behavior, add verbatim to your Text()
Button {
} label: {
HStack() {
Text(verbatim: "[email protected]")
}
}.buttonStyle(.borderedProminent).tint( .primary)