.cornerRadius() not working on 14.3 simulator

View with .cornerRadius() set is not being shown. Background should be red with round corner, but it's not visible (like it was transparent), content (text and image) is visible


Code Block
VStack {
        Text("text")
         Image("image")
 }
  .background(Color.red)
  .cornerRadius(5)

Hi,
when you want to add rounded elements to a widget you should use ContainerRelativeShape(). This will adjust the corner radius depending on its parent.
Code Block swift
VStack{
}
.background(ContainerRelativeShape())

Take care,
David
.cornerRadius() not working on 14.3 simulator
 
 
Q