Expanding table view cells disappearing

前端 未结 7 1684
傲寒
傲寒 2021-02-12 23:52

I have cells that expand by changing their height with a setExpanded: method call.

I then call reloadRowsAtIndexPaths: to refresh the cells.

The problem is the c

7条回答
  •  感情败类
    2021-02-13 00:23

    In:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    

    you must return a new cell. If cell you don't need to create a new one, you only need:

    [tableView beginUpdates];
    [tableView endUpdates];
    

    There is no need to call reloadRowsAtIndexPaths.

提交回复
热议问题