Animation issue when deleting the last row of UITableView

后端 未结 5 856
傲寒
傲寒 2021-02-05 19:19

UPDATE: This is now fixed in iOS 8.0 and above. See my accepted answer for details.

I have an iOS 7 UITableView that I allow swipe-to-delete on rows. I\'m handling delet

5条回答
  •  别跟我提以往
    2021-02-05 19:39

    my solution was to simply disable the broken animation by hiding the cell that's being deleted.

    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
        cell.hidden = YES;
    }
    

提交回复
热议问题