我被困住了。我有一个带有消息的TableView。选择后,这些将被删除并移至垃圾箱。通过在controller:didChangeContent [...] case NSFetchedResultsChangeDelete
中使用它,我可以轻松获得精灵效果,但是其他单元格后面的动画 。但我希望在其他单元格的顶部。我做错了什么?
这是动画代码:
[UIView beginAnimations:@"suck" context:NULL];
[UIView setAnimationTransition:103 forView:myCell cache:YES];
[UIView setAnimationDuration:0.5];
[UIView setAnimationPosition:CGPointMake(50, 710)];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
[UIView commitAnimations];
从here得到了想法。
答案 0 :(得分:0)
你可以尝试将你的手机放在前面:
[myCell.superview bringSubviewToFront:myCell]
答案 1 :(得分:0)
您可以从此link
获取源代码在ViewController.m文件中,执行以下更改
- (void) genieToRect: (CGRect)rect edge: (BCRectEdge) edge
{
NSTimeInterval duration = self.durationSlider.value;
CGRect endRect = CGRectInset(rect, 5.0, 5.0);
[self.buttons enumerateObjectsUsingBlock:^(UIButton *button, NSUInteger idx, BOOL *stop) {
button.enabled = NO;
}];
if (self.viewIsIn) {
[self.draggedView genieOutTransitionWithDuration:duration startRect:endRect startEdge:edge completion:^{
self.draggedView.userInteractionEnabled = YES;
[self.buttons enumerateObjectsUsingBlock:^(UIButton *button, NSUInteger idx, BOOL *stop) {
button.enabled = YES;
}];
}];
} else {
self.draggedView.userInteractionEnabled = NO;
[self.draggedView genieInTransitionWithDuration:duration destinationRect:endRect destinationEdge:edge completion:
^{
[self.buttons enumerateObjectsUsingBlock:^(UIButton *button, NSUInteger idx, BOOL *stop) {
button.enabled = YES;
}];}];
}
self.viewIsIn = ! self.viewIsIn;
}
希望它有所帮助..快乐编码!!!