iOS CoreAnimation 简单动画的使用
2015-01-05 03:02
281 查看
CAAnimationGroup 同时进行多个动画
_animateLayer.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.250].CGColor; _animateLayer.borderWidth = 2; _animateLayer.borderColor = [UIColor grayColor].CGColor; CAAnimationGroup *group = [CAAnimationGroup animation]; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"bounds"]; animation.fromValue = [NSValue valueWithCGRect:_animateLayer.bounds]; animation.toValue = [NSValue valueWithCGRect: CGRectMake(0, 0, _animateLayer.bounds.size.width + 130,_animateLayer.bounds.size.height + 130)]; CABasicAnimation *bgAnimation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"]; bgAnimation.fromValue = (__bridge id)([UIColor colorWithWhite:1.000 alpha:0.250].CGColor); bgAnimation.toValue = (__bridge id)([UIColor colorWithWhite:1.000 alpha:0].CGColor); CABasicAnimation *borderAnimation = [CABasicAnimation animationWithKeyPath:@"borderColor"]; borderAnimation.fromValue = (__bridge id)([UIColor grayColor].CGColor); borderAnimation.toValue = (__bridge id)([UIColor colorWithWhite:0.500 alpha:0.000].CGColor); CABasicAnimation *cornerAnimation = [CABasicAnimation animationWithKeyPath:@"cornerRadius"]; cornerAnimation.fromValue = @(50); cornerAnimation.toValue = @(115); group.animations = @[animation,bgAnimation,borderAnimation,cornerAnimation]; group.repeatCount = MAXFLOAT; group.duration = 1; [_animateLayer addAnimation:group forKey:nil];
水!!
我厂广招各路大神加入:job.koudaitong.com
可以发简历到 tianchi@qima-inc.com O(∩_∩)O~
相关文章推荐
- 【iOS开发-41】简单动画的万能代码——beginAnimations和commitAnimation使用频率很高
- iOS中Facebook开源动画库POP的简单使用
- iOS动画简单使用及介绍
- iOS高级-QuartzCore框架-CoreAnimation和UIView动画的使用
- iOS之帧动画最简单使用
- iOS中动画的简单使用
- 【iOS开展-50】使用它来创建一个新的类的实现代码包,因此,不自觉地练习简单MVC实验,附带动画
- iOS - (简单平移动画/弹出View的使用)
- iOS 动画篇 (二) CAShapeLayer与CoreAnimation结合使用
- CoreAnimation基础介绍、简单使用CALayer以及多种动画效果
- iOS动画的简单使用
- iOS开发 动画Animation的简单使用
- IOS动画的使用方法总结-下拉框的简单实现
- IOS autoLayout 简单的使用动画效果
- iOS-简单使用core data
- IOS简单动画
- IOS中使用CATransition创建动画方法
- IOS下SQLite的简单使用
- IOS-datePicker的简单使用
- 【iOS-Cocos2d游戏开发】使用plist文件制作简单精灵