WatchKit SwiftUI Button cornerRadius

I've been trying to set the cornerRadius on a button in my Watch app, but it only seems to work if I set the button background to a default color, i.e.

Button("Done") {

}.background(Color(.orange).cornerRadius(8.0)

If I try to set the color explicit, I get a double image of the button with a default corner radius and the one I specified, i.e.

.background(Color(white: 0.2)).cornerRadius(8.0)

If I don't set a color, cornerRadius doesn't work at all. What am I doing wrong?

It seems to be related to

.buttonStyle()

Basically, there is a light gray overlay in the button style, if you are darker than that, you can see it bleed through. My solution was to creat a new buttonStyle, but that seems like an awfully obtuse approach just to change a color or corner radius. What am I missing?

.background isn’t setting a property of the view it wraps; it's wrapping it in a new view. Same for .cornerRadius: it's clipping the view it wraps with those corners.

Try .buttonBorderShape(.roundedRectangle(8.0)).

WatchKit SwiftUI Button cornerRadius
 
 
Q