Closed ArEnSc closed 7 years ago
func collectionView(collectionView: ASCollectionView, constrainedSizeForNodeAtIndexPath indexPath: NSIndexPath) -> ASSizeRange {
let width = UIScreen.mainScreen().bounds.width
return ASSizeRangeMake(CGSizeMake(width, 0), CGSizeMake(width, CGFloat.max))
}
Found this nifty piece of code on the swift chat is this the best practice? thanks
@ArEnSc: Would it be possible to put this in a sample project for us? Thanks! I'm not exactly sure what you mean by it doesn't grow with the content. Does it show any text at all?
@hannahmbanana Ill do it in 20 minutes! =)
AsyncDemo.zip @hannahmbanana So in the documentation it says that the cell should grow with it's content, meaning that if it had text that grew a ASTextNode with multiple lines of text, the cell height should resize to accommodate that. I believe the reason why it did not grow by itself was due to the fact that the width of the ASCellNode was not set.
func collectionView(collectionView: ASCollectionView, constrainedSizeForNodeAtIndexPath indexPath: NSIndexPath) -> ASSizeRange {
let width = UIScreen.mainScreen().bounds.width
return ASSizeRangeMake(CGSizeMake(width, 0), CGSizeMake(width, CGFloat.max))
}
This piece of code was needed in order to fix that problem, which was not clear in the documentation perhaps add it in ? soon ?
Going to close this out since it's community debugging and hasn't been commented on in a while.
Async Display Version:AsyncDisplayKit (1.9.90) The Cell height Size does not appear to automatically grow with the content as per documentation.
The swift code to show the text