UIStackView Inflexible, Oversized Autolayout Bounds

Originator:spencer.samuel1
Number:rdar://32623775 Date Originated:June 07, 2017
Status:Open Resolved:
Product:Xcode Product Version:8.3, 9.0
Classification:Developer Tools Reproducible:Always
 
Summary:
In Xcode's interface builder for Storyboards, a UIStackView object (when placed in a UICollectionViewCell) maintains a width and height well beyond its content's bounds. For example, while the enclosing cell may have dimensions less than 100x100, the stack view will extend to a width and height of 1000x1000 -- an entire order of magnitude higher. The width and height of the stack view are immutable and the addition of auto layout constraints to correct the problem results in auto layout errors.

Steps to Reproduce:
1. Create a new Xcode Storyboard with a UICollectionView inside of a UIViewController
2. Add a UICollectionViewCell to the collection view
3. Add any number of labels (I used four to replicate the behavior) to the cell
4. Select all the labels in the cell and click on the "Embed in Stack" button to create a stack view with the labels
5. The stack view is now immutable for its width and height properties

Expected Results:
Stack Views should be mutable on their width and height (they are when not created in this manner). Stack views should not battle their own auto layout constraints to create errors.

Observed Results:
Stack views created with the "Embed in Stack" button inside a collection view are immutable for their width and height properties. They trigger auto layout errors in Interface Builder when attempts to correct are made by adding constraints.

Version:
Xcode 9.0 beta (9M136h)
Xcode 8.3.2 public (8E2002)

macOS 10.12.5 (16F73)

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!