1

Tweetbot 在向右滑动时向 UITableViewCell 添加了一些很酷的动画,最终揭示了让我好奇的对话:你如何为 UITableViewCell 设置动画以将其从 tableview 的正常框架中移开?

另外,您如何为表格单元顶部的其他视图设置动画?像 UIActivityMonitor 或淡入淡出按钮?

我不是在寻找何时进入编辑模式或被选中的答案,而是在一般情况下寻找答案。多谢你们。

4

1 回答 1

1
CGPoint location = [recognizer locationInView:tblview];
NSIndexPath* indexPath = [tblAim indexPathForRowAtPoint:location];

ProjectCell *cell = (ProjectCell *) [tblAim cellForRowAtIndexPath:indexPath];

if(cell.frame.origin.x!=0)
[UIView animateWithDuration:0.3 animations:^{  [cell setFrame:CGRectMake(0,cell.frame.origin.y, 320, 60 )];} completion:^(BOOL finish){
[UIView animateWithDuration:0.1 animations:^{[cell setFrame:CGRectMake(0-10,cell.frame.origin.y, 320, 60 )];} completion:^(BOOL finish){
[UIView animateWithDuration:0.1 animations:^{[cell setFrame:CGRectMake(0,cell.frame.origin.y, 320, 60 )];}];
                }];
            }];
于 2012-08-23T04:41:27.373 回答