iOS视图动画效果 CPAnimationSequence

码农软件 · 软件分类 · 图形/图像处理 · 2019-09-08 07:13:36

软件介绍

编写iOS视图UIView的动画效果需要很多代码,虽然iOS 4支持块定义,对视图动画的定义减少了不少代码,但语法依旧不好看。CPAnimationSequence是一个开源代码库,可以一种间接快捷的方式来定义描述动画队列,克服了写繁多的代码。

下面一个使用例子:
CPAnimationSequence* shakespeare = [CPAnimationSequence sequenceWithSteps:
    [CPAnimationStep           for:0.2 animate:^{ self.romeo.alpha = 1.0; }],
    [CPAnimationStep           for:0.2 animate:^{ self.julia.alpha = 1.0;  }],
    [CPAnimationStep after:1.0 for:0.7 animate:^{
                            CGPoint love = CGPointMake((self.romeo.center.x + self.julia.center.x)/2,
                                                       (self.romeo.center.y + self.julia.center.y)/2);
                            self.romeo.center = love;
                            self.julia.center = love;
    }],
    [CPAnimationStep after:2.0 for:0.5 animate:^{ self.romeo.alpha = 0.0;
                                                  self.julia.alpha = 0.0; }]
    nil];
[shakespeare run];

本文地址:https://www.codercto.com/soft/d/14121.html

Learning Web Design

Learning Web Design

Jennifer Niederst Robbins / O'Reilly Media / 2007-6-15 / USD 44.99

Since the last edition of this book appeared three years ago, there has been a major climate change with regard to web standards. Designers are no longer using (X)HTML as a design tool, but as a means......一起来看看 《Learning Web Design》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具