滑动删除
删除动画中的单元格向上,向右移动。
代码:
modelBuilder.Conventions.Remove<IdKeyDiscoveryConvention>();
我想制作短信删除动画,谢谢。
答案 0 :(得分:0)
尝试这种方式。
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.objects removeObjectAtIndex:indexPath.row];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[UIView animateWithDuration:0.25f
animations:^{
UIScrollView *internalScrollView = (UIScrollView*)cell.contentView.superview;
if([internalScrollView isKindOfClass:[UIScrollView class]]){
[internalScrollView setContentOffset:CGPointZero animated:YES];
}
cell.center = CGPointMake(cell.center.x + cell.bounds.size.width, cell.center.y);
// cell.backgroundColor = [UIColor blueColor];
} completion:^(BOOL finished) {
//[cell removeFromSuperview];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
}];
}
}