fix: flow layout load more view not span entirely

This commit is contained in:
王劲鹏 2021-06-11 14:40:13 +08:00 committed by osborn
parent cbaa560dea
commit 188e3b55f6

View File

@ -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];
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];
}