CABasicAnimation-平移
来源:互联网 发布:centos 打不了中文 编辑:程序博客网 时间:2024/04/27 22:46
//平移- (void)animationTranslate{ //创建layer CALayer *layer =[CALayer layer]; layer.bounds = CGRectMake(0, 0, 100, 100); layer.position = CGPointMake(100,100); layer.backgroundColor = [UIColor yellowColor].CGColor; [self.view.layer addSublayer:layer]; //1.创建动画对象 CABasicAnimation *animation = [CABasicAnimation animation]; //2.设置动画 // keyPath 决定了执行怎样的动画 animation.keyPath = @"position"; // toValue 到达哪个点,byValue是增加多少值,fromValue 从哪个点开始移动 animation.toValue = [NSValue valueWithCGPoint:CGPointMake(200, 200)]; animation.duration = 2; animation.removedOnCompletion = NO;//动画执行完毕后不删除动画 //保持最新的状态 animation.fillMode = @"forwards"; //3.添加动画 [layer addAnimation:animation forKey:nil];}
0 0
- CABasicAnimation-平移
- CABasicAnimation-旋转
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- CABasicAnimation
- ios-day18-08(使用CABasicAnimation实现对UIView的平移、旋转、缩放)
- 关于CABasicAnimation —实现简单的滚动、平移、翻转、缩放动画
- m2eclipse 中maven插件的使用及构建简单的项目(二)
- TCP三次握手及四次挥手详细图解
- laravel学习1
- 记录
- Servlet容器与Web容器
- CABasicAnimation-平移
- 浮点型数据的舍入误差
- iOS 证书申请和使用详解(详细版)
- 字典树——字典树树模板
- 截取Chrome下载的mp3
- Spring AOP
- SQLite自定义聚合函数 [类似MAX(field)]
- 派生类虚函数调用基类版本
- Android onCreate 详解