fix: iOS load more view abnormal when item count zero
This commit is contained in:
parent
98f2d29cee
commit
800365645c
@ -174,6 +174,7 @@ - (instancetype)initWithContext:(DoricContext *)doricContext {
|
|||||||
_itemSizeInfo = [NSMutableDictionary new];
|
_itemSizeInfo = [NSMutableDictionary new];
|
||||||
_batchCount = 15;
|
_batchCount = 15;
|
||||||
_columnCount = 2;
|
_columnCount = 2;
|
||||||
|
_loadAnchor = -1;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@ -344,13 +345,13 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
|
|||||||
DoricFlowLayoutItemNode *node = cell.viewNode;
|
DoricFlowLayoutItemNode *node = cell.viewNode;
|
||||||
node.viewId = model[@"id"];
|
node.viewId = model[@"id"];
|
||||||
[node blend:props];
|
[node blend:props];
|
||||||
if (position > 0 && position >= self.itemCount) {
|
if (position >= self.itemCount) {
|
||||||
node.view.width = collectionView.width;
|
node.view.width = collectionView.width;
|
||||||
} else {
|
} else {
|
||||||
node.view.width = (collectionView.width - (self.columnCount - 1) * self.columnSpace) / self.columnCount;
|
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];
|
[self callLoadMore];
|
||||||
}
|
}
|
||||||
[node.view.doricLayout apply];
|
[node.view.doricLayout apply];
|
||||||
|
Reference in New Issue
Block a user