Question: So I just started developing with SwiftUI and I'm running in a small problem. Subviews are also displaying superview's shadow, even if the superview has a background. Does someone know how to fix this?

```
HStack {
    HStack {
        [...]
    }
    .padding(.leading, 12.0)
    .padding(.trailing, 4.0)
    .padding(.vertical, 16.0)
    .background(Color("lightGreen"))
    .cornerRadius(10)
}
.padding(8)
.background(Color.white)
.shadow(color: Color("tabShadow"), radius: 0.0, x: 0.0, y: -0.5)
.shadow(color: Color("tabShadow"), radius: 0.0, x: 0.0, y: 0.5)

```

As stated, the first HStack's shadow shouldn't be replicated into the child one, but it is. Only the first one though. Any hints?

Answer: 
I am also newbie in swiftUI , but I think the problem is related to modifiers order and the fact that they change the View type.

I was able to solve the problem by adding .background(Color.white) and .cornerRadius(2.0) modifiers just before the shadow modifier and that applied the changes in parent (not children) View.

```
struct TestSwiftUIView: View {    
    var body: some View {
        VStack {
            Text("Hello World")
            Text("Hello World")
        }
        .padding()
        .background(Color.white)
        .cornerRadius(2.0)
        .shadow(radius: 3)
    }
}

```
If you want to prevent the shadow the be applied to subviews then use the shadow modifier only inside the .background modifier like so:

```
VStack {
 ...       
}.background(Color.white.shadow(color: .black.opacity(0.3), radius: 1, x: 1, y: 1))

```