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];//关闭动画
查看全文
相关阅读:
Java 从入门到进阶之路(五)
Java 从入门到进阶之路(四)
Java 从入门到进阶之路(三)
Java 从入门到进阶之路(二)
Java 从入门到进阶之路(一)
调用百度翻译 API 来翻译网站信息
jquery.i18n 网站呈现各国语言
VUE+Element UI实现简单的表格行内编辑效果
Python 爬虫从入门到进阶之路(十八)
Python 爬虫从入门到进阶之路(十七)
原文地址:https://www.cnblogs.com/wujie123/p/5330838.html
最新文章
pyqtgraph嵌入到pyqt5中
pyqtgraph--用PlotWidget绘制图形
pyqtgraph--动态更新数据
python-切片
pyqtgraph--用addplot绘制图像
python--pyqtgraph学习目录
pyqt5-拖拽
QT中全局变量的定义
C++ QT中自定义控件的简单创建
测试
热门文章
struts2、hibernate以及spring是如何配置的
C语言之链表的使用
volatile关键字
函数查表、逗号运算符 解决数学运算问题
C语言编程需要掌握的核心要点有哪些? 编程大神为你总结了这20个
技术实操丨使用ModelArts和HiLens Studio完成云端验证及部署
【DevCloud · 敏捷智库】两种你必须了解的常见敏捷估算方法
技术干货丨通过wrap malloc定位C/C++的内存泄漏问题
一文带你了解Web前端发展历程
实战案例丨代码优化:如何去除context中的warning?
Copyright © 2011-2022 走看看