In my app, I have a Scene which has the following layout:
View
- Scroll View
- View (called "noSidewaysView")
- Three Stack Views
- Text View 1
- Text View 2
- View (called "noSidewaysView")
In this layout, noSidewaysView has the following constraints:
- Trailing, Leading, Bottom, and Top to Superview with constant = 0 for all four
- Equal Width to Superview
- Height Equals 500 @ 250
- Height ≥ 500 ( @ 1000 )
The topmost stack view is constrained to Trailing, Leading, and Top to the noSidewaysView.
The second stack view is constrained to Trailing and Leading to the noSideways View, and Top to the topmost stackview's bottom (set to Standard Value).
The third stack view is constrained to Trailing and Leading to the noSidewaysView, and top to the second stackview's bottom (set to Standard Value).
All three stack views contain items with intrinsic content sizes.
Text view 1 is constrained to Trailing and Leading to the noSideways view, and top to the third stackview's bottom set to Standard Value. It is also height constrained = 75.
All of these constraints (except Text View 1's height) are set to "0".
Text View 2 is constrained to Trailing and Leading to the noSidewaysView with a value of "0". It has a Bottom constraint to the noSidewaysView of "0". It has two height constraints, Height = 156 @ 250 and Height ≥ 156 @ 1000. It also has a Top constraint to Text View 1's bottom, which is set to Standard Value.
To me, that should result in Text View 2's top being pinned to Text View 1's bottom, and at 156 pixels high unless there is more room, in which case it is at least 156 pixels high but stays pinned to the bottom of the noSidewaysView (which is pinned to the bottom of the Scroll View, which is pinned to the bottom of the View at the topmost spot in the hierarchy).
What I am seeing, however, is that Text View 2 is always exactly 156 pixels high, no matter what happens. If I remove the height = constraint, it complains (and, I think, understandably) about ambiguous layouts.
There are no layout issues in the Scene, yellow or red. I feel like I am missing a vital link, here, that will allow me to understand why Text View 2 doesn't stay pinned to the bottom of the noSidewaysView (and, therefore, the bottom of the Scroll View), even though I think it probably ought to. I tried changing Text View 2's Top constraint priority to 999 to allow the Bottom constraint to be the slightly more important, but that had no effect on it.
Edit: I neglected to point out that Scroll View is pinned top/bottom/leading/trailing to the topmost View.