iOS:fix when reuse node,call reset cause property lost
This commit is contained in:
parent
a4ccb10891
commit
02ca1e5081
@ -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;
|
||||
|
@ -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"];
|
||||
|
@ -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"];
|
||||
|
@ -146,4 +146,12 @@ - (NSArray *)getSubNodeViewIds {
|
||||
|
||||
return allKeys;
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
[super reset];
|
||||
for (NSString *viewId in self.subNodes.allKeys) {
|
||||
[[self subNodeWithViewId:viewId] reset];
|
||||
}
|
||||
|
||||
}
|
||||
@end
|
||||
|
@ -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]]) {
|
||||
|
Reference in New Issue
Block a user