【文件属性】:
文件名称:ForAnimation:CALayer的各种动画效果
文件大小:18KB
文件格式:ZIP
更新时间:2021-05-22 20:03:58
Objective-C
ForAnimation
CALayer的各种动画效果
Introduce
IOS--CALayer实现,界限、透明度、位置、旋转、缩放组合动画
基于框架:QuartzCore.framework
//抖动
CABasicAnimation* shake = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
//设置抖动幅度
shake.fromValue = [NSNumber numberWithFloat:-0.2];
shake.toValue = [NSNumber numberWithFloat:+0.2];
shake.duration = 0.1f;
shake.repeatCount = fDuration/4/0.1f;
shake.autoreverses = YES;
效果如下:
//界
【文件预览】:
ForAnimation-master
----TestForAnimation()
--------ViewController.m(5KB)
--------Info.plist(1KB)
--------main.m(340B)
--------Base.lproj()
--------Images.xcassets()
--------ViewController.h(278B)
--------AppDelegate.h(283B)
--------AppDelegate.m(2KB)
----README.md(3KB)
----TestForAnimation.xcodeproj()
--------project.xcworkspace()
--------xcuserdata()
--------project.pbxproj(16KB)
----TestForAnimationTests()
--------Info.plist(743B)
--------TestForAnimationTests.m(892B)