diff --git a/doric-iOS/Pod/Classes/Shader/DoricListNode.m b/doric-iOS/Pod/Classes/Shader/DoricListNode.m index 745c6ef7..16b44bca 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricListNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricListNode.m @@ -207,6 +207,7 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position { - (void)blendSubNode:(NSDictionary *)subModel { ///Here async blend sub node because the item count need to be applied first. + NSUInteger currentCount = self.itemCount + (self.loadMore ? 1 : 0); dispatch_async(dispatch_get_main_queue(), ^{ NSString *viewId = subModel[@"id"]; DoricViewNode *viewNode = [self subNodeWithViewId:viewId]; @@ -220,8 +221,13 @@ - (void)blendSubNode:(NSDictionary *)subModel { [self.itemViewIds enumerateKeysAndObjectsUsingBlock:^(NSNumber *_Nonnull key, NSString *_Nonnull obj, BOOL *_Nonnull stop) { if ([viewId isEqualToString:obj]) { *stop = YES; - NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[key integerValue] inSection:0]; [UIView performWithoutAnimation:^{ + NSUInteger itemCount = self.itemCount + (self.loadMore ? 1 : 0); + if (itemCount <= [key integerValue] || currentCount != itemCount) { + [self.view reloadData]; + return; + } + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[key integerValue] inSection:0]; [self.view reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone]; }]; }