2011-07-01 43 views
2

我卡住了。我有一个带有消息的TableView。一旦选择,这些将被删除并移至垃圾箱。我通过在controller:didChangeContent [...] case NSFetchedResultsChangeDelete中使用它而获得真正容易的精​​灵效果,但它的动画落后于其他细胞。但我希望在其他单元格的顶部。我究竟做错了什么?动画与精灵效应的UITableViewCell

这里是动画代码:

[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

这些都是私有API,Apple可能会拒绝您的应用。 –

回答

0

你可以尝试这样做使你的向前:

[myCell.superview bringSubviewToFront:myCell] 
+0

这没有办法。 :(和以前一样,无论如何Thx。 – soelu

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; 
} 

希望它有助于..快乐编码!