From c82510f57a327cbb461975f3b5d4dc2b6ad6be88 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Thu, 15 Jul 2021 18:07:59 +0800 Subject: [PATCH] iOS: fix flowlayout loadmoreView do not show on content --- doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m index cd2f6b71..745d378a 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m @@ -111,11 +111,15 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde if (width == self.collectionView.width) { x = 0; - CGFloat maxY = 0; - for (NSNumber *column in self.columnHeightInfo.allValues) { - maxY = MAX(maxY, [column floatValue]); + NSNumber *maxYColumn = @(0); + for (NSNumber *key in sortedKeys) { + if ([self.columnHeightInfo[key] floatValue] > [self.columnHeightInfo[maxYColumn] floatValue]) { + maxYColumn = key; + } } + CGFloat maxY = [self.columnHeightInfo[maxYColumn] floatValue]; y = maxY + self.rowSpace; + self.columnHeightInfo[maxYColumn] = @(y + height); } else { self.columnHeightInfo[minYOfColumn] = @(y + height); }