Home > Enterprise >  Unwanted space below vertical stack using interface builder
Unwanted space below vertical stack using interface builder

Time:06-10

There is an unwanted space below my last container ("Container View 5") that I can't seem to get rid of. All 5 of my container views are within a vertical stack view. The bottom space of the stack view is set to the superview and should have no space. Any idea what I am missing?

enter image description here

enter image description here

enter image description here enter image description here enter image description here enter image description here

CodePudding user response:

You have force-dictated the heights of the Container Views 2-5, so there is no reason why they would, taken together, fill the height of the device.

To see this, simply imagine that Container View 1 has a height of 10. Then the other views have a combined height of 67.5, for a grand total of 77.5, which obviously would be smaller than the height of any known device.

Basically this appears to be an incorrect use of a stack view. You don't give any information about how the stack view is configured, so it's impossible to say more at this point. I'm a little surprised, though, that you do not report getting some sort of constraint conflict message in the Xcode console.

CodePudding user response:

It turns out it was not the stack or containers but the constraints on a separate view itself that I embedded in the last container. The constraints on the containers and stack work great.

  • Related