Skip to content

reloadData回弹 #282

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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