0

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:

enter image description here

and with the activated condition:

enter image description here

11
  • Needed minimal reproducible example. Commented Sep 30, 2021 at 6:41
  • @Asperi, which details do you need? I thought that this info is enough :( Commented Sep 30, 2021 at 6:43
  • seems like your BottomSheetView which is on top, covers the padding area of your VStack. add a minimal reproducible example. Commented Sep 30, 2021 at 7:31
  • As a minimal reproducible example, in this case, you can provide different images of the layouts, so that the differences can be seen visually. Commented Sep 30, 2021 at 7:32
  • @Yodagama I have added example Commented Sep 30, 2021 at 7:34

1 Answer 1

1

Well hard to answer your question because there is not so much code but you can try...

VStack(alignment: .leading) { .... } .padding() 

or you add the padding (.all, 17) information to all your textfields like

VStack{ Text("Hello Stackoverflow") .padding(.all,17) } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.