Expanding table view cells disappearing

前端 未结 7 1662
傲寒
傲寒 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:29

    Okay...

    before you

    previousIndexPath_ = indexPath;
    

    and after you do all the expanding / contracting of heights etc; you need to do something like

    [cellArray replaceObjectAtIndex:previousIndexPath_ withObject:previousCell];
    [cellArray replaceObjectAtIndex:indexPath withObject:cell];
    

    which means your cellArray needs to be

    NSMutableArray* cellArray;
    

提交回复
热议问题