IOS UITable 插入和删除的动画

objective C代码

[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:IndexPaths withRowAnimation:UITableViewRowAnimationRight];
[self.tableView deleteRowsAtIndexPaths:IndexPaths withRowAnimation:UITableViewRowAnimationRight];
[self.tableView endUpdates];

NSArray *IndexPaths = [[NSArray alloc] initWithObjects:
			[NSIndexPath indexPathForRow:0 in section:0],nil];

其中,动作类型分别有

typedef enum {
   UITableViewRowAnimationFade ,
   UITableViewRowAnimationRight ,
   UITableViewRowAnimationLeft ,
   UITableViewRowAnimationTop ,
   UITableViewRowAnimationBottom ,
   UITableViewRowAnimationNone ,
   UITableViewRowAnimationMiddle ,
   UITableViewRowAnimationAutomatic  = 100
} UITableViewRowAnimation;

你可能感兴趣的:(iOS基础)