-
Notifications
You must be signed in to change notification settings - Fork 452
Open
Description
children添加完数据想将他默认展开。但是我reloadData再expandRowForItem。展开了 但是列表滚到第一条数据了。这是因为什么呢
NSMutableArray *children = [[NSMutableArray alloc]init];
for (NSDictionary *child in dic[@"data"]) {
NSMutableDictionary *cataDic = [[NSMutableDictionary alloc]init];
cataDic[@"name"] = child[@"typeName"];
cataDic[@"code"] = child[@"catalogCode"];
cataDic[@"typeCode"] = child[@"typeCode"];
cataDic[@"isLeaf"] = child[@"isLeaf"];
RADataObject *childcataModel = [RADataObject dataObjectWithName:@"" children:nil];
childcataModel.type = 1;
childcataModel.cataDic = cataDic;
[children addObject:childcataModel];
}
cataModel.children = [[NSArray alloc]initWithArray:children];
[self.treeTableview reloadData];
[UIView animateWithDuration:0. animations:^{
[self expandRows:self.data];
} completion:^(BOOL finished) {
}];
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels