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];
|
||||
_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];
|
||||
|
Reference in New Issue
Block a user