[ASViewController] Remeasure node with new constrained size when propagating trait collection (#2143)

This commit is contained in:
Adlai Holler
2016-08-25 21:21:44 -07:00
committed by GitHub
parent 47d84aa7fe
commit 480ba8c3fa
3 changed files with 96 additions and 0 deletions

View File

@@ -116,7 +116,12 @@ ASVisibilityDidMoveToParentViewController;
{
[super viewWillAppear:animated];
_ensureDisplayed = YES;
// We do this early layout because we need to get any ASCollectionNodes etc. into the
// hierarchy before UIKit applies the scroll view inset adjustments, if you are using
// automatic subnode management.
[_node measureWithSizeRange:[self nodeConstrainedSize]];
[_node recursivelyFetchData];
if (_parentManagesVisibilityDepth == NO) {
@@ -295,6 +300,8 @@ ASVisibilityDepthImplementation;
}
// once we've propagated all the traits, layout this node.
// Remeasure the node with the latest constrained size old constrained size may be incorrect.
[self.node measureWithSizeRange:[self nodeConstrainedSize]];
[self.node setNeedsLayout];
}
}