2 years ago

#55394

test-img

MCRG

How can I draw a view on top (z axis) of another, without using ZStack? In Swift/SwiftUI

So I have this problem (see image to have a clearer idea). I have a something like this:

NavigationView {
    VStack {
        Spacer()
        HStack {}
        Divider()
        List{}
    }
    .toolbar((placement: .bottomBar))
}

the list draws below the VStack, just as intended. However, the shadow of the list is drawing on top of the VStack for some reason. Is there any way to draw the shadow below the other stack without using the ZStack? (I want to avoid having to deal with paddings to make this look the same) There is also a tab bar below, where the same thing happens (the list is behind the bar, but the shadow draws on top from the edge

List somehow on top and below top bar:

enter image description here

ios

swift

swiftui

swift3

0 Answers

Your Answer

Accepted video resources