From 800365645c299bd541d20709c6a28fa22f97557e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Thu, 8 Jul 2021 11:28:32 +0800 Subject: [PATCH] fix: iOS load more view abnormal when item count zero --- doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m index 832ed877..7d68fd11 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m @@ -174,6 +174,7 @@ - (instancetype)initWithContext:(DoricContext *)doricContext { _itemSizeInfo = [NSMutableDictionary new]; _batchCount = 15; _columnCount = 2; + _loadAnchor = -1; } return self; } @@ -344,13 +345,13 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection DoricFlowLayoutItemNode *node = cell.viewNode; node.viewId = model[@"id"]; [node blend:props]; - if (position > 0 && position >= self.itemCount) { + if (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) { + if (position >= self.itemCount && self.onLoadMoreFuncId) { [self callLoadMore]; } [node.view.doricLayout apply];