iOS: when cell height not zero don't remove
This commit is contained in:
parent
2e7fe08764
commit
ff92ac5b16
@ -174,7 +174,13 @@ - (void)blendView:(UITableView *)view forPropName:(NSString *)name propValue:(id
|
|||||||
[self removeSubModel:obj];
|
[self removeSubModel:obj];
|
||||||
}];
|
}];
|
||||||
[self.itemViewIds removeAllObjects];
|
[self.itemViewIds removeAllObjects];
|
||||||
[self.itemHeights removeAllObjects];
|
NSMutableDictionary *map = self.itemHeights.mutableCopy;
|
||||||
|
[self.itemHeights enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, NSNumber *obj, BOOL * _Nonnull stop) {
|
||||||
|
if ([obj isEqualToNumber:@(0)]) {
|
||||||
|
[map removeObjectForKey:key];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
self.itemHeights = map.mutableCopy;
|
||||||
self.needReload = true;
|
self.needReload = true;
|
||||||
}
|
}
|
||||||
} else if ([@"batchCount" isEqualToString:name]) {
|
} else if ([@"batchCount" isEqualToString:name]) {
|
||||||
@ -724,7 +730,13 @@ - (void)reload {
|
|||||||
[self removeSubModel:obj];
|
[self removeSubModel:obj];
|
||||||
}];
|
}];
|
||||||
[self.itemViewIds removeAllObjects];
|
[self.itemViewIds removeAllObjects];
|
||||||
[self.itemHeights removeAllObjects];
|
NSMutableDictionary *map = self.itemHeights.mutableCopy;
|
||||||
|
[self.itemHeights enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, NSNumber *obj, BOOL * _Nonnull stop) {
|
||||||
|
if ([obj isEqualToNumber:@(0)]) {
|
||||||
|
[map removeObjectForKey:key];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
self.itemHeights = map.mutableCopy;
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
self.rowCount = self.itemCount + (self.loadMore ? 1 : 0);
|
self.rowCount = self.itemCount + (self.loadMore ? 1 : 0);
|
||||||
[self.view reloadData];
|
[self.view reloadData];
|
||||||
|
Reference in New Issue
Block a user