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];
|
[itemNode initWithSuperNode:self];
|
||||||
cell.viewNode = itemNode;
|
cell.viewNode = itemNode;
|
||||||
[cell.contentView addSubview:itemNode.view];
|
[cell.contentView addSubview:itemNode.view];
|
||||||
|
} else {
|
||||||
|
[cell.viewNode reset];
|
||||||
}
|
}
|
||||||
|
|
||||||
DoricFlowLayoutItemNode *node = cell.viewNode;
|
DoricFlowLayoutItemNode *node = cell.viewNode;
|
||||||
|
@ -165,6 +165,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
|
|||||||
cell.backgroundColor = [UIColor clearColor];
|
cell.backgroundColor = [UIColor clearColor];
|
||||||
listItemNode.view.width = tableView.width;
|
listItemNode.view.width = tableView.width;
|
||||||
[cell.contentView addSubview:listItemNode.view];
|
[cell.contentView addSubview:listItemNode.view];
|
||||||
|
} else {
|
||||||
|
[cell.doricListItemNode reset];
|
||||||
}
|
}
|
||||||
DoricListItemNode *node = cell.doricListItemNode;
|
DoricListItemNode *node = cell.doricListItemNode;
|
||||||
node.viewId = model[@"id"];
|
node.viewId = model[@"id"];
|
||||||
|
@ -163,6 +163,8 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
|
|||||||
[slideItemNode initWithSuperNode:self];
|
[slideItemNode initWithSuperNode:self];
|
||||||
cell.doricSlideItemNode = slideItemNode;
|
cell.doricSlideItemNode = slideItemNode;
|
||||||
[cell.contentView addSubview:slideItemNode.view];
|
[cell.contentView addSubview:slideItemNode.view];
|
||||||
|
} else {
|
||||||
|
[cell.doricSlideItemNode reset];
|
||||||
}
|
}
|
||||||
DoricSlideItemNode *node = cell.doricSlideItemNode;
|
DoricSlideItemNode *node = cell.doricSlideItemNode;
|
||||||
node.viewId = model[@"id"];
|
node.viewId = model[@"id"];
|
||||||
|
@ -146,4 +146,12 @@ - (NSArray *)getSubNodeViewIds {
|
|||||||
|
|
||||||
return allKeys;
|
return allKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)reset {
|
||||||
|
[super reset];
|
||||||
|
for (NSString *viewId in self.subNodes.allKeys) {
|
||||||
|
[[self subNodeWithViewId:viewId] reset];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
@ -103,9 +103,6 @@ - (UIView *)build {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)blend:(NSDictionary *)props {
|
- (void)blend:(NSDictionary *)props {
|
||||||
if (self.superNode.reusable) {
|
|
||||||
[self reset];
|
|
||||||
}
|
|
||||||
for (NSString *key in props) {
|
for (NSString *key in props) {
|
||||||
id value = props[key];
|
id value = props[key];
|
||||||
if (!value || [value isKindOfClass:[NSNull class]]) {
|
if (!value || [value isKindOfClass:[NSNull class]]) {
|
||||||
|
Reference in New Issue
Block a user