ios 中心放大动画
来源:互联网 发布:linux临时设置环境变量 编辑:程序博客网 时间:2024/04/19 05:40
-(void)animationOfCABasicAnimation{ UIView *redView=[[UIView alloc]initWithFrame:CGRectMake(10, 10, 100, 100)]; redView.backgroundColor=[UIColor redColor]; [self.view addSubview:redView]; //创建一个CABasicAnimation对象 CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"]; redView.layer.anchorPoint = CGPointMake(.5,.5); animation.fromValue = @0.0f; animation.toValue = @1.0f; //动画时间 animation.duration=1; //是否反转变为原来的属性值 // animation.autoreverses=YES; //把animation添加到图层的layer中,便可以播放动画了。forKey指定要应用此动画的属性 [redView.layer addAnimation:animation forKey:@"scale"];}
组合动画和时间轴:
-(void) combineAnimation{ UIView *redView=[[UIView alloc]initWithFrame:CGRectMake(10, 10, 100, 100)]; redView.backgroundColor=[UIColor redColor]; [self.view addSubview:redView]; //创建一个CABasicAnimation对象 CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"]; redView.layer.anchorPoint = CGPointMake(.5,.5); // animation.fromValue = @2.0f; animation.toValue = @0.5f; //动画时间 animation.duration=1; animation.beginTime=CACurrentMediaTime()+1; //是否反转变为原来的属性值 // animation.autoreverses=YES; //把animation添加到图层的layer中,便可以播放动画了。forKey指定要应用此动画的属性 [redView.layer addAnimation:animation forKey:@"scale"]; CABasicAnimation *theAnimation; // create the animation object, specifying the position property as the key path // the key path is relative to the target animation object (in this case a CALayer) theAnimation=[CABasicAnimation animationWithKeyPath:@"position"]; // set the fromValue and toValue to the appropriate points theAnimation.fromValue=[NSValue valueWithCGPoint:CGPointMake(74.0,74.0)]; theAnimation.toValue=[NSValue valueWithCGPoint:CGPointMake(300.0,406.0)]; // set the duration to 3.0 seconds theAnimation.duration=3.0; // set a custom timing function theAnimation.timingFunction=[CAMediaTimingFunction functionWithControlPoints:0.25f :0.1f :0.25f :1.0f]; [redView.layer addAnimation:theAnimation forKey:@"move"];}
0 0
- ios 中心放大动画
- iOS 图片放大缩小动画
- ios 图片放大缩小动画效果
- 【IOS动画】UIView放大缩小背景淡入淡出动画效果
- 从中心放大
- 图片中心放大
- iOS 开发常用的动画 放大缩小 和 透明度变化
- iOS开发中动画之点赞图标放大效果
- UIView放大动画
- 放大缩小动画
- UIView的放大动画
- ImageView逐渐放大动画
- android 放大图片动画
- 鼠标经过,图片会放大(从中心位置放大)
- JS运动-放大缩小物体(从中心)
- ios 组合动画实现图片浏览,效果为图片放大并淡出
- ios拼图游戏(六)之拼图放大动作以及相应动画
- iOS自定义转场详解03——实现通过圆圈放大缩小的转场动画
- Eclipse中导入工程,文件中的中文注释显示为乱码 更改字体大小
- Python网络爬虫——爬取POJ题目
- java--xiti
- Enum_枚举笔记
- BZOJ 1024: [SCOI2009]生日快乐
- ios 中心放大动画
- 20分钟自动安装kilo版本openstack开发环境
- 判断请求URL中是IP还是域名
- ios高级工程师开发面试题
- 在Linux里设置环境变量的方法(export PATH)
- 【11/02】 iOS开发成长之路,【控件初始化方法封】
- -Dmaven.multiModuleProjectDirectory system propery is not set.IDEA14 中Maven报错
- 利用C++优势快速打完最长不下降子序列
- Windows远程到Linux