2012-05-01 38 views
0

我有一張桌子,我注意到當我做「滑動刪除」時,紅色按鈕只有第一次動畫,返回(如果我做另一個滑動)沒有動畫消失。這是我用此步驟的方法:UITableView滑動返回動畫

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView 
     editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 

return UITableViewCellEditingStyleDelete; 

} 

- (void)tableView:(UITableView *)tableView 
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle 
forRowAtIndexPath:(NSIndexPath *)indexPath { 

... 

} 
- (void)tableView:(UITableView *)tableView 
didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath { 

[tableView reloadData]; 

} 

我忘了什麼事能激起回報?

非常感謝!

回答

2

是的,省略了[tableView reloadData];。您只需要重新加載表格-tableView:commitEditingStyle:etc:,並且可以說即使不是那樣 - 最好使用UITableView方法-deleteRowsAtIndexPaths:withRowAnimation:。重新加載它是不必要的,這就是爲什麼你的刪除按鈕正在消失,而不是動畫。

+0

好的,非常感謝! – Vins

+0

對不起,但尚未正常工作:( – Vins

+0

問題可能是單元格是自定義單元格? – Vins