Subview layout margins do not apply during table cell height calculation
| Originator: | ilya.konstantinov | ||
| Number: | rdar://28600418 | Date Originated: | October 3, 2016 |
| Status: | Resolved: | ||
| Product: | iOS | Product Version: | 10 |
| Classification: | Reproducible: | Yes |
Area: UIKit Summary: Subview layout margins do not apply during table cell height calculation. Steps to Reproduce: 1. Create a UITableView with autolayout heights (UITableViewAutomaticDimension). 2. Add a subview to the content view and set its layout margin to explicit non-default (e.g. bottom=250 instead of 8). 3. Add a sub-subview with some height (either intrinsic or constraint-based). 4. Create a chain of top-to-bottom constraints (to margins) so that table cell height can be calculated. See attached example with two cells — one sized incorrectly, one sized correctly. Setting subview's preservesSuperviewLayoutMargins = true works around the issue for some reason I cannot understand. Expected Results: Table cell height takes inner subview margins into consideration. Actual Results: (8,8,8,8) margins are used during table cell height calculation. Version: iOS 10.0 Notes: Configuration: iOS Simulator Attachments: 'TableViewAutoHeightWithMargins.zip' was successfully uploaded.
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!