Open garrettmoon opened 7 years ago
@ArEnSc the cells aren't created yet when this method is called, ASDK needs the results of this method to create the cell. If you want the cells to size automatically with no constraints, you should be able to return ASSizeRangeMake(CGSizeZero, CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX))
.
You may not even need to implement this method, as the default behavior may be what you desire :)
From @ArEnSc on September 26, 2016 22:19
@garrettmoon The issue is I have a ASCollectionNodeX that is nested in a ASCellNodeY and I need to resize the ASCellNode to what the ASCollectionNodeX and its children are how would I attempt to do that? There doesn't seem to be an easy way.
From @hannahmbanana on January 13, 2017 4:8
@ArEnSc - I believe right now, the collection nodes have no way to report their own size. The current work around is write a method that queries each of your cells (ASCellNodeY
) and call layoutThatFits:
on each of them with the same constrainedSize
that the collection would. You can do this loop on a background thread. If the same cell nodes are provided to the collection, then the layout will be cached and not need to recompute. Based on the size of the cell nodes, you can set the .style.preferredSize
of the inner collection node and call -setNeedsLayout
on it's parent.
We should probably modify one of our example to do this. Any volunteers?
From @hannahmbanana on January 13, 2017 4:10
This framework improvement / feature request is duplicated by #954.
TODO(Hannah): Close once documentation is produced for the current workaround.
From @ArEnSc on September 24, 2016 19:16
AsyncDisplayKit (1.9.90) Am I missing something here ? thanks
Copied from original issue: facebookarchive/AsyncDisplayKit#2293