From 188e3b55f6410c185e3aaf754d282d208e4b7dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Fri, 11 Jun 2021 14:40:13 +0800 Subject: [PATCH] fix: flow layout load more view not span entirely --- doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m index 55f5d163..22ee1a7b 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m @@ -105,6 +105,7 @@ - (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]); @@ -338,7 +339,12 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection DoricFlowLayoutItemNode *node = cell.viewNode; node.viewId = model[@"id"]; [node blend:props]; - node.view.width = (collectionView.width - (self.columnCount - 1) * self.columnSpace) / self.columnCount; + if (position > 0 && position >= self.itemCount) { + node.view.width = collectionView.width; + } else { + node.view.width = (collectionView.width - (self.columnCount - 1) * self.columnSpace) / self.columnCount; + } + if (position > 0 && position >= self.itemCount && self.onLoadMoreFuncId) { [self callLoadMore]; }