美文网首页iOS开发你需要知道的
(抄)UITableVIewCell在显示时逐个滑入动效

(抄)UITableVIewCell在显示时逐个滑入动效

作者: MSG猿 | 来源:发表于2016-06-22 11:47 被阅读196次

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

//1. Setup the CATransform3D structure

CATransform3D rotation;

rotation = CATransform3DIdentity;

rotation =  CATransform3DTranslate(rotation, 30, 0, 0); //CATransform3DMakeRotation( (15*M_PI)/180, 0.0, 0.7, 0.5);

rotation.m34 = 1.0/ -500;

//2. Define the initial state (Before the animation)

cell.layer.shadowColor = [[UIColor blackColor]CGColor];

cell.layer.shadowOffset = CGSizeMake(10, 10);

cell.alpha = 0.0;

cell.layer.transform = rotation;

cell.layer.anchorPoint = CGPointMake(0, 0.5);

//!!!FIX for issue #1 Cell position wrong------------

if(cell.layer.position.x != 0){

cell.layer.position = CGPointMake(0, cell.layer.position.y);

}

//3. Define the final state (After the animation) and commit the animation

double secondsDelay = indexPath.row *0.08;

if (secondsDelay > 0.6) {

secondsDelay = 0.1;

}

[UIView animateWithDuration:0.5 delay:secondsDelay usingSpringWithDamping:1.0 initialSpringVelocity:0.5 options:0 animations:^{

cell.layer.transform = CATransform3DIdentity;

cell.alpha = 1;

cell.layer.shadowOffset = CGSizeMake(0, 0);

} completion:^(BOOL finished) {}];

}

相关文章

  • (抄)UITableVIewCell在显示时逐个滑入动效

    -(void)tableView:(UITableView *)tableView willDisplayCell...

  • jQuery 动画总结

    jQuery 动画 说明 1、隐藏和显示 显示方法 show ( ) 隐藏方法hide ( ) 2、滑入/滑出 动...

  • 交互动效- day①

    在分析一个动效时,我会以这样的思路来思考:动效所在的页面和位置——这是一个怎样的动效——这个页面的使用场景是怎样的...

  • 动效设计-交互设计的最后一公里(三)

    在《动效设计-交互设计的最后一公里(一)》中,作者已经将动效的类型划分为四种:品牌类动效、引导类动效、转场类动效、...

  • APP动效设计

    什么是动效 动效,在APP中比较常见了,简单的如加载loading,列表下拉刷新,复杂的如应用删除时图标闪动(苹果...

  • 些优质移动app动效设计的建议

    一些优质移动app动效设计的建议: 1.动效不应分散用户在屏幕上重要功能上的注意力。 2.设计动效时应该考虑到应用...

  • iOS tableView复用机制描述

    主要描述下,以下三个方法: 只要cell要显示在可见范围时就会调用 - (UITableViewCell*)tab...

  • SDWebImage的一些使用功能

    使用场景:自定义的UITableViewCell上有图片需要显示, 要求网络状态为WIFI时, 显示图片高清图; ...

  • 论状态动效中的信息传递

    首先我们简单的先将游戏内动效分为两类:“状态”动效和“行为”动效。状态动效:永远单向传递信息行为动效:动效基于交互...

  • 腾讯出品的交互微动效设计指南

    本设计指南适用于UI设​计界面中交互微动效,涵盖入场、出场动效,过渡动效和加载动效,在时间和缓动曲线的选择上提供了...

网友评论

    本文标题:(抄)UITableVIewCell在显示时逐个滑入动效

    本文链接:https://www.haomeiwen.com/subject/xftndttx.html