Reputation: 114
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)
Upvotes: 1
Views: 104
Reputation: 1521
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)
Upvotes: 3