移动动画
来源:互联网 发布:wings夺冠 知乎 编辑:程序博客网 时间:2024/05/21 10:14
CALayer *lbl = [view layer];
CGPoint posLbl = [lbl position];
CGPoint y = CGPointMake(posLbl.x-10, posLbl.y);
CGPoint x = CGPointMake(posLbl.x+10, posLbl.y);
CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"position"];
[animation setTimingFunction:[CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[animation setFromValue:[NSValue valueWithCGPoint:x]];
[animation setToValue:[NSValue valueWithCGPoint:y]];
[animation setAutoreverses:YES];
[animation setDuration:0.08];
[animation setRepeatCount:3];
[lbl addAnimation:animation forKey:nil];
CGPoint posLbl = [lbl position];
CGPoint y = CGPointMake(posLbl.x-10, posLbl.y);
CGPoint x = CGPointMake(posLbl.x+10, posLbl.y);
CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"position"];
[animation setTimingFunction:[CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[animation setFromValue:[NSValue valueWithCGPoint:x]];
[animation setToValue:[NSValue valueWithCGPoint:y]];
[animation setAutoreverses:YES];
[animation setDuration:0.08];
[animation setRepeatCount:3];
[lbl addAnimation:animation forKey:nil];
0 0
- 移动动画
- android动画-移动动画问题
- Android 移动动画- TranslateAnimation
- Android 移动动画- TranslateAnimation
- QML-动画-移动字符串
- UIView动画移动效果
- 移动动画问题
- 简单移动动画
- iOS触摸移动动画
- 【动画】TranslateAnimation 移动控件
- TranslateAnimation移动动画Demo
- 足球移动动画
- css3移动端动画
- TranslateAnimation 动画移动
- html移动动画
- 属性动画的移动
- 移动动画 移动之后停留在那里
- gif动画效果 移动动画效果
- 微笑通聊天界面的实时获取
- 两种C++命令行编译器的使用
- java中读取properties文件,并将文件内容转换成map并返回
- android MotionEvent中getX()和getRawX()的区别
- Python布局,读写文件
- 移动动画
- WWDC2014之iOS使用动态库
- 黑马程序员————集合_1
- 【并发编程】AIDL关键字
- VS2010 中error MSB4030的解决
- 微信功能系列-微商城定制开发示例
- 搜索引擎索引之如何更新索引
- Spring对Hibernate事务管理
- Cocos2d-X 学习笔记 9 CCACtion运行完后回调