Button has two different colors, even if only specified one

I want to fit a button to the whole screen of my apple watch. But there is a lighter red and a dark red like in this picture. enter image description here

This is my code: I want the whole screen to have only one color if this is possible. Thanks

Button(action: {
                Task {
                    if (!muteWatch) {
                        WKInterfaceDevice.current().play(.failure)
                    }
                    Task {
                        await isWorkingSince()
                    }
                }
            }, label: {
                Text("Stop ".localized() + stopTimeString).padding().frame(
                    minWidth: 0,
                    maxWidth: .infinity,
                    minHeight: 0,
                    maxHeight: .infinity,
                    alignment: .topLeading
                  ).background(Color.red)
            }).padding().frame(
                minWidth: 0,
                maxWidth: .infinity,
                minHeight: 0,
                maxHeight: .infinity,
                alignment: .topLeading
              ).background(Color.red)

>Solution :

You need plain button style, like

    Button(action: {}) {
        Text("Hello, World!")
        .frame(maxWidth: .infinity, maxHeight: .infinity)
        .background(.red)
    }
    .buttonStyle(.plain)    // << here !!

Tested with Xcode 13.4 / watchOS 8.5

demo

Leave a Reply