2011-12-01 18 views

回答

0

有幾種方法as described in the docs

批量插入,刪除和行的登陸艦和第

的的UITableView類可以插入,刪除,並重新加載行的一組 或部分,同時以指定的方式動畫操作 。清單 7-7中顯示的八種方法適用於批量插入和刪除。請注意,您可以在動畫塊之外調用 這些插入和刪除方法(如 在數據源方法 tableView:commitEditingStyle:forRowAtIndexPath中的操作:如 「在編輯模式下插入和刪除行」中所述)。

清單7-7批量插入和刪除方法

- (void)beginUpdates; 
- (void)endUpdates; 

- (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation; 
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation; 
- (void)reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation; 

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation; 
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation; 
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation; 
+0

呀,然而,動畫是 - 每一個行向被動畫,我更喜歡新rows-的嵌段動畫 – Dekim

相關問題