动画Uitableviewcell

时间:2012-08-23 04:24:40

标签: objective-c iphone uitableview cocoa-touch core-animation

Tweetbot在向右滑动时向UITableViewCell添加了一些很酷的动画,最终揭示了让我好奇的对话:你如何动画UITableViewCell使其远离tableview的正常框架?

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

我不是在寻找进入编辑模式或被选中的答案,而是一般而言。谢谢你们。

1 个答案:

答案 0 :(得分: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 )];}];
                }];
            }];