diff --git a/doric-iOS/Pod/Classes/Shader/DoricListNode.m b/doric-iOS/Pod/Classes/Shader/DoricListNode.m index c11a72f2..3bd863d5 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricListNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricListNode.m @@ -139,7 +139,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N DoricListItemNode *listItemNode = [[DoricListItemNode alloc] initWithContext:self.doricContext]; [listItemNode initWithSuperNode:self]; cell.doricListItemNode = listItemNode; - cell.backgroundColor=[UIColor clearColor]; + cell.backgroundColor = [UIColor clearColor]; listItemNode.view.width = tableView.width; [cell.contentView addSubview:listItemNode.view]; } @@ -225,11 +225,14 @@ - (void)callItem:(NSUInteger)position height:(CGFloat)height { if (old && [old isEqualToNumber:@(height)]) { return; } + NSUInteger currentCount = self.itemCount + (self.loadMore ? 1 : 0); self.itemHeights[@(position)] = @(height); if (@available(iOS 10.0, *)) { dispatch_async(dispatch_get_main_queue(), ^{ [UIView performWithoutAnimation:^{ - if([self.view numberOfRowsInSection:0]<=position){ + NSUInteger itemCount = self.itemCount + (self.loadMore ? 1 : 0); + if ([self.view numberOfRowsInSection:0] <= position || currentCount != itemCount) { + [self.view reloadData]; return; } NSIndexPath *indexPath = [NSIndexPath indexPathForRow:position inSection:0];