1
我有我的UITableView
(刷卡)刪除方法以標準方式設置。如果多個單元格的UITableView沒有動畫刪除
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.tableView beginUpdates];
/*
code…
*/
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
[self.tableView endUpdates];
}
}
的UITableViewRowAnimationFade
動畫完美的作品,如果有表視圖,或者如果我刪除的最後一個單元只有一個格,但如果我嘗試刪除上面的最後一排,將不再使用當我點擊刪除時動畫。我怎樣才能解決這個問題?
此外,我使用自定義單元格(只是一個標籤和圖像視圖),如果它有任何區別。