Код: Выделить всё
Menu("Actions") {
Button(action: { }) {
Label("Whatever", systemImage: "pencil")
.background(Color.red) // does not work
}
.background(Color.red) // does not work either
.buttonStyle(RedButtonStyle()) // does not work either
}
struct RedButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label.foregroundColor(Color.red)
}
}
Есть ли какой-нибудь способ сделать это?
PS: есть еще один связанный с этим вопрос SO, но он очень общий и более широкий по своему охвату.
п>
Подробнее здесь: https://stackoverflow.com/questions/662 ... in-swiftui
Мобильная версия