I have ZStack with two views one of which can be shown due to the condition:
ZStack{ VStack{ ... }.padding(.all,17) if handler.bottomVisible { BottomSheetView(handler: handler, player: true) } } but when I uncomment these lines:
if handler.bottomVisible { BottomSheetView(handler: handler, player: true) } my .padding(.all,17) for VStack becomes damaged. Without this view, everything looks ok, but after adding the second child view for ZStack UI doesn't see paddings for VStack. Maybe I did smth wrong?
Example without bottom sheet:
and with the activated condition:


BottomSheetViewwhich is on top, covers the padding area of your VStack. add a minimal reproducible example.