Skip to content

reloadData回弹 #282

@btxXiaoXiao

Description

@btxXiaoXiao

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) {
          
      }];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions