Fix content inset problems if ASViewControllers root node has usesImplicitHierarchyManagement set to YES

There are content inset problems if a ASViewController is initialized with a root node (e.g a ASCollectionNode subclass) that has usesImplicitHierarchyManagement set to YES. The reason for that is that the subviews (e.g. the UICollectionView) of the ASViewController root node get's added to the view hierarchy in measureWithSizeRange: in ASDisplayNode.  measureWithSizeRange: of the root node is called in -viewWillLayoutSubviews in ASViewController. That is too late, so UIKit does not apply the automatic content inset to the UICollectionView anymore.
This commit is contained in:
Michael Schneider
2016-03-04 19:22:09 -08:00
parent 0a76c7b5d2
commit 15a789c719

View File

@@ -85,6 +85,7 @@
{
[super viewWillAppear:animated];
_ensureDisplayed = YES;
[_node measureWithSizeRange:[self nodeConstrainedSize]];
[_node recursivelyFetchData];
[self updateCurrentRangeModeWithModeIfPossible:ASLayoutRangeModeFull];