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];//关闭动画
查看全文
相关阅读:
在线添加磁盘,扩展LVM卷案例
iOS 通过代码关闭应用程序
hdu1443(约瑟夫环游戏的原理 用链表过的)
Mapper映射语句高阶应用——ResultMap
SeekBar和RatingBar
Myeclipse中如何修改Tomcat的端口号
新浪微博客户端开发之OAuth认证篇
层层递进Struts1(六)自定义转换器
CF 13E Holes 【块状链表】
《mysql必知必会》学习_第13章
原文地址:https://www.cnblogs.com/wujie123/p/5330838.html
最新文章
nyoj158-省赛来了
nyoj212-k尾相等数
nyoj56-阶乘因式分解(一)
nyoj48-小明的调查作业
辗转相除法求最大公约数与最小公倍数
C语言求大数的阶乘
nyoj181-小明的难题
nyoj125-盗梦空间
nyoj124-中位数
欧拉函数:HDU3501-Calculation 2
热门文章
素数筛选:HDU2710-Max Factor
欧拉函数:HDU1787-GCD Again(欧拉函数的模板)
水题:51Nod 1163-最高的奖励
线段树:POJ3468-A Simple Problem with Integers(线段树注意事项)
水题:51Nod1095-Anigram单词
二叉排序树:POJ2418-Hardwood Species(外加字符串处理)
二叉排序树:HUD3999-The order of a Tree(二叉排序树字典序输出)
二叉排序树:HDU3791-二叉搜索树(用指针建立二叉排序树)
树状数组:CDOJ1583-曜酱的心意(树状数组心得)
系统集成项目管理之项目进度管理
Copyright © 2011-2022 走看看