SwiftUI button bug

Viewed 21

i have 2 SwiftUI buttons for a macOS program. This is how they are supposed to look like:

Correct look

However on some devices they are looking like this:

Incorrect look

I haven't been able to see a pattern on which devices it's incorrect and not. Here is the code i am using for the 2 buttons.

label: {
   Text("Camera Test\nMachineProfile")
       .font(.largeTitle)
       .fontWeight(.bold)
       .padding()
       })
       .buttonStyle(SampleStyle())
struct SampleStyle: ButtonStyle {
    func makeBody(configuration: Self.Configuration) -> some View {
        configuration.label
            .padding(13)
            .background(!configuration.isPressed ?
                        Color(.gray) :
                            Color(.blue))
            .foregroundColor(!configuration.isPressed ? .black : .black)
            .cornerRadius(18.0)
    }
}

Anyone able to help me figure out what's wrong?

0 Answers
Related