0
我有以下幾行代碼:的iOS:UITableViewRowAnimationFade工作不正常
- (void)tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[tableViewData removeObjectAtIndex:indexPath.row]; // Step 1
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationFade]; // Step 2
if (!queue_C5K) { // Step 3
LockrNotificationDataKeeper *LLDK =
[[LockrNotificationDataKeeper alloc] initWithData:@"##deletion##"
andIndexPath:(int)indexPath.row
andType:@"dR"
delegate:self];
[queue_C5K addOperation:LLDK];
}
}
}
所以我請從當前UITableView
數據所選擇的UITableViewCell
在步驟1在步驟2中,animation
應該發生。在步驟3中,所選數據將從datasource
(plist)中刪除。步驟3的回調將重新加載我的UITableView
。
問題是,只有最後一個UITableViewCell
刪除動畫。所有上面的UITableViewCells
不。所以如果我有5個單元格,前4個單元格在刪除時沒有任何動畫。
我做錯了什麼?
我會試試看。感謝您的關注。 – filou
是的,這有助於:)。 – filou