Post

Replies

Boosts

Views

Activity

Reply to swiftui zstack alignment not working
I have not tried Geometry reader yet as I am just trying to understand the basic behaviour and what the heck is going on. I realize the text within each hstack is aligned topleading however that is not my concern. The zstack alignment is top leading so from my understanding every child (hstack's) should be aligned to the top leading edge of the zstack. This is the case when I add the fisrt hstack. It aligns to the top leading edge as expected. However as soon as the second hstack is added the e first hstack centers in the zstack view. I expect both hstacks to align to top leading since they are both children of the zstack which has a top leading alignment modifier.I would love to show you the images but can't figure out how to add images to this thread.
Mar ’20
Reply to swiftui zstack alignment not working
After a ton of experimenting I found I can make it work if the HStack frames are set to the exact same size as the ZStack frame. This works for me in my situation but it still seems like a bug. In the above example if stack 1 is by itself then it moves to top leading. But as soon as you add stack 2 then stack 1 goes to centered.
Feb ’20