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)
    }
}

```
You can try 'overlay' and 'background' tricks when you have to make them render in multiple passes. In above case, the overlay will not be affected by the shadow or other effects. 

If you think they are subViews, actually, they just render after the superView. It's a 2D world. So the overlay will be quite independently. 

The only problem is just the size of overlay. 

The hidden() is used here to occupy the position of invisible overlay. It's very cool if you master these layout skills.

```
struct ContentView: View {

var body: some View {

HStack {
    SubContentView().hidden()
}
.padding(8)
.background(Color.white)
.shadow(color: Color.red, radius: 0, x: 0.0, y: -0.5)
.shadow(color: Color.red, radius: 0, x: 0.0, y: 0.5)

.overlay(SubContentView())

}
}

struct SubContentView: View {
var body: some View {
    HStack{
               Text("a")
                Text("b")
                Text("c")
               Text("a")
               Text("b")
               Text("c")
           }.padding(.leading, 12.0)
           .padding(.trailing, 4.0)
           .padding(.vertical, 16.0)
           .background(Color.green)
           .cornerRadius(10)
}
}

```