Unexpected behavior in Interface Builder using stack views

Originator:bob
Number:rdar://33759550 Date Originated:07-Aug-2017 04:01 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9 beta 5
Classification:UI/Usability Reproducible:Always
 
Summary:
When trying to use stack views in standalone nibs in interface builder of Xcode 9 beta 5, we are getting strange issues where the frame width of the stack view crushes down to 0 when pinned on all sides to the top level parent view. It appears to have something to do with the intrinsic size of the labels placed inside of the stack view. Sometimes it will show one of the labels, along with a bunch of (incorrect) warnings about the vertical compression/hugging priorities of the labels in the stack view. Most of the time, it just crushes the whole stack view down to the left, though this isn’t consistent from file to file.

Steps to Reproduce:
1. Create a standalone nib with a top level view
2. Add a stack view as a subview, and pin all edges to the parent view
3. Add several labels (maybe multiline labels), adjust the compression/hugging so that it should be satisfied
4. If you don’t already see issues, set the metrics to freeform size, and drag the view frame around

Expected Results:
No issues, the stack view takes up the view parent view, and stacks the labels appropriately without warnings.

Actual Results:
Sometimes the frame of the stack view is crushed to 0 width, sometimes one label is shown with a bunch of vertical priority warnings.

Version:
Xcode 9 beta 5

Notes:
We see this in a number of views created with an early Xcode 9 beta. When I create one from scratch, I still get weird behavior, but can’t seem to get the frame jumping to zero width.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!