UIStackView: Hidden views persist with invalid frames on rotation

Originator:zwaldowski
Number:rdar://21510105 Date Originated:23-Jun-2015 01:35 PM
Status:Open Resolved:false
Product:iOS SDK Product Version:iOS 9.0 beta 2 (13A4280e)
Classification:Serious Bug Reproducible:Always
 
Summary:
When using stack views, it is advantageous to hide or show views in different size classes. Combined with per-trait configuration for the stack view itself, this creates extremely dynamic UIs across devices.

When a view is shown on change of size class, returning to the original size class (necessitating that the view be hidden), it sticks around with an invalid frame.

Steps to Reproduce:
1. Create a Single View iOS Application project.
2. Add a UIStackView to the Main storyboard.
3. Set the Distribution of the UIStackView to "Fill Equally".
4. Add constraints for the UIStackView to the edges to the container.
5. Add three views to the stack view, each with a different background color.
6. For the third view, add a trait to be uninstalled for Any Width, Compact Height.
7. Run the application in any iPhone simulator that does not have a Compact height in portrait (iPhone 6, 6 Plus).
8. Rotate the simulator to landscape.

Expected Results:
The third view appears on rotation to landscape, in equal size to the other two, and hides on rotation to portrait.

Actual Results:
The third view appears on rotation to landscape, in equal size to the other two. When rotating back to portrait, the third view disappears and the first two views are resized correctly. When the rotation animation completes, the third view appears at the top of the container with its old height (when landscape) and at a fullscreen width.

Version:
iOS 9.0 beta 2 (13A4280e)

Notes:
View Debugging indicates that no constraints are applied to the erroneous third view. Despite it being displayed outside the bounds of the stack view, it is neither clipped nor does it have a negative origin to its frame.

Configuration:
iPhone 6 Plus

Attachments:
'TestStack.zip' was successfully uploaded.

Comments

Referenced TestStack.zip: https://drive.google.com/file/d/0B3FglI-wO7EqMnVsSnpQSDF4OG8/view?usp=sharing

By zwaldowski at June 23, 2015, 8:38 p.m. (reply...)

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!