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];//关闭动画
查看全文
相关阅读:
北京半年经历
我眼中的ASP.NET.MVC
工作中遇到的js跨域问题总结
c#double类型保留百分号后两位,且禁止四舍五入的方法
c# 深入探索之CLR
关于Sql Server的一些知识点的定义总结
c中结构体边界对齐
随便记点
数据库 三个范式
mysql-5.7.14-winx64解压版配置
原文地址:https://www.cnblogs.com/wujie123/p/5330838.html
最新文章
Python 垃圾回收机制
MySQL B+ 树索引
重置剪切板缓存,拯救假死的剪切板
Cortex-M4的快速memcpy,根据数据对齐情况自动优化,速度为普通memcpy的1.3到5.2倍
Ubuntu 16.04 安装CP210x,CH340驱动
Ubuntu安装Windows官方版QQ和微信(使用deepin wine)
火狐Firefox 52.90版是最后一个支持WinXP和Vista的版本
关闭Eclipse CDT工具栏上的编译按钮(LaunchBar)
Python标准组件ConfigParser配置文件解析器,保存配置时支持大写字母的方法
Git for Windows,TortoiseGit支持WinXP的最后版本及下载方法
热门文章
Cannot uninstall 'enum34'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Python + winpcap抓包和发包
Python最小二乘法解非线性超定方程组
使用CocoaLumberjack时,自定义的log文件名
iOS开发,使用CocoaSSDP查找设备时按关键字过滤Device
iOS开发,在main thread以外的thread更新UI
Kafak探究之路- 内部结构小结
Kafka探究之路-命令小结
集群、分布式、SOA、微服务、webService等思想的整理
开发知识点链接
Copyright © 2011-2022 走看看