IOS UITable 插入和删除的动画

来源:互联网 发布:对流风和穿堂风知乎 编辑:程序博客网 时间:2024/04/28 17:24

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;
1 0
原创粉丝点击