iOS开发只简单动画实现
2024-08-27 21:59:03
1.动画旋转:
[UIViewbeginAnimations:@"View Flip"context:nil]; //声明,@"XX"为标题,
[UIViewsetAnimationDuration:1.25]; //持续时间
[UIViewsetAnimationCurve:UIViewAnimationCurveEaseInOut]; //设置动画曲线
//加入新的坐标 //旋转视图
[UIViewsetAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:self.viewcache:YES]; ///调用
2.左右晃动动画:
// start the wiggling animation
CGFloatrotation =0.03; CABasicAnimation*shake = [CABasicAnimation animationWithKeyPath:@"transform"];
shake.duration = 0.13;
shake.autoreverses = YES;
shake.repeatCount = MAXFLOAT;
shake.removedOnCompletion = NO;
shake.fromValue = [NSValue valueWithCATransform3D:CATransform3DRotate(self.layer.transform,-rotation, 0.0 ,0.0 ,1.0)];
shake.toValue = [NSValue valueWithCATransform3D:CATransform3DRotate(self.layer.transform, rotation, 0.0 ,0.0 ,1.0)]; [self.layeraddAnimation:shake forKey:@"shakeAnimation"]; //然后在退出的时候移除
[self.layer removeAnimationForKey:@"shakeAnimation"];
3、
CATransform3D transformBefore = CATransform3DIdentity;
transformBefore.m34 = 0.0005;
transformBefore = CATransform3DRotate(transformBefore,(M_PI/*), , , );
instroduceLayer.layer.transform = transformBefore;
instroduceLayer.layer.anchorPoint = CGPointMake(0.0, 0.5); [UIViewanimateWithDuration:1animations:^{
CATransform3D transform = CATransform3DIdentity;//单位矩阵
transform.m34 = 0.0005;
transform = CATransform3DRotate(transform,(M_PI/*), , , );
instroduceLayer.layer.transform = transform;
}];
最新文章
- 以冒泡排序为例--malloc/free 重定向stdin stdout
- CEF使用的几个注意点
- ab压力测试和CC预防
- [转]Windows Shell 编程 第四章 【来源 http://blog.csdn.net/wangqiulin123456/article/details/7987933】
- 【UVA1371】Period (二分+DP)
- 初涉JavaScript模式 (4) : 构造函数
- first day for new job
- java类加载器行为[笔记]
- java中的对象
- iOS开发之判断横竖屏切换
- Django内置Admin
- 如何把kotlin+spring boot开发的项目部署在tomcat上
- Python3 条件控制
- cadence学习一------>;介绍
- window下安装 node ,并搭建 vue 项目
- Hadoop专有名词
- JavaWeb:一个Servelt多个请求
- [浅谈CSS核心概念] CSS布局模型:float和position
- VS Code .vue文件代码缩进以及格式化代码
- android 中解析json格式数据
热门文章
- 实验一 Java开发环境的熟悉(Linux + Idea) 20175301李锦然
- IScroll5不能滑到最底端的解决办法
- reduce/filter/map/zip/isinstance/list列表推导式
- Exp2 后门原理与实践 20164314 郭浏聿
- 第十三届东北师范大学程序设计竞赛热身赛 C(exgcd+欧拉函数)
- iOS 开发 ZFUI framework控件,使布局更简单
- selenium采用xpath方法识别页面元素
- 三, 练习 python索引 (list和tuple)
- JavaScript代码规范
- Python3学习笔记(urllib模块的使用)