iOS核心动画keypath
来源:互联网 发布:上海华测导航待遇知乎 编辑:程序博客网 时间:2024/05/18 06:41
transform.rotation:旋转动画。
transform.rotation.x:按x轴旋转动画。
transform.rotation.y:按y轴旋转动画。
transform.rotation.z:按z轴旋转动画。
transform.scale:按比例放大缩小动画。
transform.scale.x:在x轴按比例放大缩小动画。
transform.scale.y:在y轴按比例放大缩小动画。
transform.scale.z:在z轴按比例放大缩小动画。
position:移动位置动画。
opacity:透明度动画strokeEnd :颜色从无到有
strokeStart :颜色从有到无
// Do any additional setup after loading the view, typically from a nib. // (360°- 30°) ->(180°+30°) 逆时针的圆弧 CD圆弧 UIBezierPath *path1 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.view.center.x,self.view.center.y) radius:100 startAngle:2 * M_PI - DEGREES_TO_RADIANS(30) endAngle:M_PI + DEGREES_TO_RADIANS(30) clockwise:NO]; // (3/2π- 60°) ->(-1/2π -60°) 逆时针的圆 DD′圆 UIBezierPath *path2 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.view.center.x,self.view.center.y) radius:100 startAngle:M_PI *3/2 - (M_PI_2 - DEGREES_TO_RADIANS(30)) endAngle:-M_PI_2 - (M_PI_2 -DEGREES_TO_RADIANS(30)) clockwise:NO];// [path1 appendPath:path2]; CAShapeLayer *layer = [CAShapeLayer layer]; layer.path = path1.CGPath; layer.strokeColor = [UIColor redColor].CGColor; layer.fillColor = [UIColor clearColor].CGColor; layer.lineWidth = 5; CAShapeLayer *layer1 = [CAShapeLayer layer]; layer1.path = path2.CGPath; layer1.strokeColor = [UIColor yellowColor].CGColor; layer1.fillColor = [UIColor clearColor].CGColor; layer1.lineWidth = 5; //方案1 CAKeyframeAnimation *startAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeStart"]; startAnimation.values = @[@0,@1]; startAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; startAnimation.duration = 2 ; startAnimation.repeatCount = 100; startAnimation.delegate = self; startAnimation.removedOnCompletion = 1; CAKeyframeAnimation *EndAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeEnd"]; EndAnimation.values = @[@0,@1]; EndAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; EndAnimation.duration = 2; EndAnimation.repeatCount = 100; EndAnimation.delegate = self; EndAnimation.removedOnCompletion = 1; CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; animationGroup.animations = [NSArray arrayWithObjects:startAnimation,nil]; animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; animationGroup.duration = 3; animationGroup.repeatCount = 100; animationGroup.delegate = self; animationGroup.removedOnCompletion = 1; [animationGroup setValue:@"animationStep3" forKey:@"animationName"]; [layer addAnimation:startAnimation forKey:nil]; [layer1 addAnimation:EndAnimation forKey:nil]; [self.view.layer addSublayer:layer]; [self.view.layer addSublayer:layer1];
0 0
- iOS核心动画keypath
- iOS Layer动画的KeyPath
- 关于iphone核心动画编程对应的keypath
- iOS动画 核心动画
- iOS核心动画----基础动画
- iOS 核心动画-基础动画
- iOS 核心动画 -基础动画
- iOS动画篇:核心动画
- iOS动画篇:核心动画
- iOS动画篇:核心动画
- iOS动画篇:核心动画
- iOS动画篇:核心动画
- ios动画篇:核心动画
- ios 核心动画
- iOS核心动画
- ios核心动画
- iOS 核心动画合成
- iOS核心动画-1
- iOS页面禁止侧滑返回
- partent()、partents()、closeset()区别
- MYSQL远程访问,授权IP等常用命令
- android屏幕监听,手机是否处于锁屏状态,在锁屏之上弹出Toast.makeText消息
- c#解析Json文件实例学习
- iOS核心动画keypath
- Arduino 自动初始化ESP8266为透传模式
- 剑指-二进制相加进位
- MVP与MVC
- c#解析EXCEL文件实例复习
- CCF-201403-2-窗口
- Android Studio提交库至Bintray jCenter从入门到放弃
- 基于接口的对象实例,泛型
- 与adb相关的问题,比如掉线问题、Android Studio 提示Session 'app':Error Installing APK、找不到设备