How can we change the colour of an Alert button? #87
Answered
by
mbrandonw
Muhammed9991
asked this question in
Q&A
-
I thought something like below would work. But it doesn't AlertState(
title: {
TextState("Some title")
},
actions: {
ButtonState(
action: .send(.cancel),
label: {
TextState("Cancel")
.foregroundColor(.red)
})
}, message: {
TextState("Some message")
.bold()
}) |
Beta Was this translation helpful? Give feedback.
Answered by
mbrandonw
Mar 10, 2023
Replies: 1 comment 2 replies
-
Hi @Muhammed9991, vanilla SwiftUI does not support customizing the color of alert buttons, and so there is nothing we can do. The best you can do is give the button a |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Muhammed9991
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Muhammed9991, vanilla SwiftUI does not support customizing the color of alert buttons, and so there is nothing we can do. The best you can do is give the button a
role: .destructive
. That will make it red.