Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reloadData回弹 #282

Open
btxXiaoXiao opened this issue Jul 19, 2024 · 0 comments
Open

reloadData回弹 #282

btxXiaoXiao opened this issue Jul 19, 2024 · 0 comments

Comments

@btxXiaoXiao
Copy link

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) {
          
      }];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant