zoukankan
html css js c++ java
UIView的基本属性及ANimation
frame属性:可以使用该属性改变尺寸和位置 相对于父视图
bounds:改变尺寸 相对自身
center:改变视图的位置
alpha:改变视图的透明度
backgroundColor:改变视图的背景
contentStretch:改变视图内容如何拉伸
//开始动画
[UIView beginAnimations:@"wap view" context:nil];
//设置时常
[UIView setAnimationDuration:1];
//设置动画
淡入淡出
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
//设置代理
[UIView setAnimationDelegate:self];
//设置翻转方向
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:manImageView cache:YES];
//动画结束
[UIView commitAnimations];
旋转动画
创建一个CGAffineTransform transform对象 CGAffineTransform transform;
//设置旋转度数
transform = CGAffineTransformRotate(manImageView.transform,M_PI/6.0);
//动画开始
[UIView beginAnimations:@"rotate" context:nil ];
//动画时常
[UIView setAnimationDuration:2];
//添加代理
[UIView setAnimationDelegate:self];
//获取transform的值
[manImageView setTransform:transform];
//关闭动画
[UIView commitAnimations];
偏移动画
[UIView beginAnimations:@"move" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationDelegate:self];
//改变它的frame的x,y的值 manImageView.frame=CGRectMake(100,100, 120,100);
[UIView commitAnimations];
翻页动画
[UIView beginAnimations:@"curlUp" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];//指定动画曲线类型,该枚举是默认的,线性的是匀速的
//设置动画时常 [UIView setAnimationDuration:1];
[UIView setAnimationDelegate:self]; //设置翻页的方向
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:manImageView cache:YES];
//关闭动画
[UIView commitAnimations];
缩放动画
CGAffineTransform transform;
transform = CGAffineTransformScale(manImageView.transform,1.2,1.2);
[UIView beginAnimations:@"scale" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationDelegate:self];
[manImageView setTransform:transform];
[UIView commitAnimations];
取反的动画效果是根据当前的动画取他的相反的动画
CGAffineTransform transform;
transform=CGAffineTransformInvert(manImageView.transform);
[UIView beginAnimations:@"Invert" context:nil];
[UIView setAnimationDuration:2];//动画时常
[UIView setAnimationDelegate:self];
[manImageView setTransform:transform];
//获取改变后的view的transform [UIView commitAnimations];//关闭动画
查看全文
相关阅读:
三维动画形变算法(Mixed Finite Elements)
点集配准技术(ICP、RPM、KC、CPD)
自由变形技术(Free-Form Deformation)
物体自由落体动态模拟(Linear Subspace)
小球自由落体动态模拟(Position Based Simulation)
基于谱聚类的三维网格分割算法(Spectral Clustering)
基于均值漂移的三维网格分割算法(Mean Shift)
基于模糊聚类和最小割的层次化三维网格分割算法(Hierarchical Mesh Decomposition)
基于网格的分割线优化算法(Level Set)
骨骼蒙皮动画算法(Linear Blending Skinning)
原文地址:https://www.cnblogs.com/wujie123/p/5330838.html
最新文章
lightGBM所需的glibc2.14快速解决方案
更多文章请关注公众号:FullStackPlan 或前往个人主页:www.linbingdong.com
字符串查找算法总结(暴力匹配、KMP 算法、Boyer-Moore 算法和 Sunday 算法)
分布式一致性算法:Raft 算法(论文翻译)
ZeroMQ初探
全球分布式数据库:Google Spanner(论文翻译)
Hadoop YARN介绍
Java NIO之内存映射文件——MappedByteBuffer
Stack Overflow上关于Java Collections的几个常见问题
分布式系列文章——Paxos算法原理与推导
热门文章
分布式系列文章——从ACID到CAP/BASE
【转】Selenium-xpath详解
【转】python selenium2 中的显示等待WebDriverWait与条件判断expected_conditions举例
WebDriver介绍
【转】Selenium-WebDriverApi接口详解
centos7 mysql数据库安装和配置
[Python]SQLAlchemy
python性能测试工具框架
CentOS之NTP服务器配置
快速操作Linux终端命令行的快捷键列表
Copyright © 2011-2022 走看看