首页 > 其他 > 详细

UITableView滑动动画+FPSLabel

时间:2015-12-08 14:19:09      阅读:209      评论:0      收藏:0      [点我收藏+]

主要使用了tableView的代理方法

行将要显示的时候

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(nonnull NSIndexPath *)indexPath

代码:

   cell.contentView.alpha = 0.3;
    CGAffineTransform transformScale = CGAffineTransformMakeScale(0.3,0.8); //缩放
    CGAffineTransform transformTranslate = CGAffineTransformMakeTranslation(0.5, 0.6);//改变位置
    
    cell.contentView.transform = CGAffineTransformConcat(transformScale, transformTranslate);
    [tableView bringSubviewToFront:cell.contentView];
    [UIView animateWithDuration:.4f
                          delay:0.05
                        options:UIViewAnimationOptionAllowUserInteraction
                     animations:^{
                         
                         cell.contentView.alpha = 1;
                         
                         //清空 transform
                         
                         cell.contentView.transform = CGAffineTransformIdentity;
                     } completion:nil];

效果图:

技术分享

github连接:

https://github.com/WuJiForFantasy/CellAnimation

 

UITableView滑动动画+FPSLabel

原文:http://www.cnblogs.com/hxwj/p/5028804.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!