diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m index c8462fc8..24317a24 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m @@ -371,6 +371,8 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection [itemNode initWithSuperNode:self]; cell.viewNode = itemNode; [cell.contentView addSubview:itemNode.view]; + } else { + [cell.viewNode reset]; } DoricFlowLayoutItemNode *node = cell.viewNode; diff --git a/doric-iOS/Pod/Classes/Shader/DoricListNode.m b/doric-iOS/Pod/Classes/Shader/DoricListNode.m index e44a045d..1925abc8 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricListNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricListNode.m @@ -165,6 +165,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.backgroundColor = [UIColor clearColor]; listItemNode.view.width = tableView.width; [cell.contentView addSubview:listItemNode.view]; + } else { + [cell.doricListItemNode reset]; } DoricListItemNode *node = cell.doricListItemNode; node.viewId = model[@"id"]; diff --git a/doric-iOS/Pod/Classes/Shader/DoricSliderNode.m b/doric-iOS/Pod/Classes/Shader/DoricSliderNode.m index 6f3c7bd2..3a315a9a 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricSliderNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricSliderNode.m @@ -163,6 +163,8 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection [slideItemNode initWithSuperNode:self]; cell.doricSlideItemNode = slideItemNode; [cell.contentView addSubview:slideItemNode.view]; + } else { + [cell.doricSlideItemNode reset]; } DoricSlideItemNode *node = cell.doricSlideItemNode; node.viewId = model[@"id"]; diff --git a/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m b/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m index 14552434..4b840e0e 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m @@ -146,4 +146,12 @@ - (NSArray *)getSubNodeViewIds { return allKeys; } + +- (void)reset { + [super reset]; + for (NSString *viewId in self.subNodes.allKeys) { + [[self subNodeWithViewId:viewId] reset]; + } + +} @end diff --git a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m index 02ef3e59..f15a4ed5 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricViewNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricViewNode.m @@ -103,9 +103,6 @@ - (UIView *)build { } - (void)blend:(NSDictionary *)props { - if (self.superNode.reusable) { - [self reset]; - } for (NSString *key in props) { id value = props[key]; if (!value || [value isKindOfClass:[NSNull class]]) {