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];//关闭动画
查看全文
相关阅读:
IP掩码的作用
linux shell 笔记
ubuntu apt-get Failed to fetch Temporary failure resolving 'security.ubuntu.com'
ubuntu 16.04 & 18.04 远程桌面使用
取消Ubuntu开机硬盘自检
linux shell 脚本输入参数解析
Ubuntu 16.04 + python3 源码 安装+使用labelImg最新版
用tinyxml2读写xml文件_C++实现
常用工具问题及解决方案
可视化调试工具
原文地址:https://www.cnblogs.com/wujie123/p/5330838.html
最新文章
我的游戏学习日志20——游戏元素的解析(4)
我的游戏学习日志19——游戏元素的解析(3)
我的游戏学习日志18——游戏元素的解析(2)
我的游戏学习日志17——游戏元素的解析(1)
我的游戏学习日志16——类型游戏的分析(4)
我的游戏学习日志15——类型游戏的分析(3)
我的游戏学习日志14——类型游戏的分析(2)
我的游戏学习日志13——类型游戏的分析(1)
虚拟机VMWare开机黑屏 无法进入系统
测试linux python import module
热门文章
Python 脚本的执行
Ubuntu下安装Python3(与旧Python2版本共存)
将 VS2017下开发的程序, 部署到其他电脑上运行
unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source 解决办法
VS2017 添加预定义宏
WIN7下安装Python3.7和labelImg-1.7.0
笔记本+ubuntu18.04 关闭触摸板touchpad
VS2017 提示找不到某个.dll库,或某个dll库丢失,原因
VS在调试桌面程序时,cout到控制台方法
Win7/Win10+VS2017+OpenCV3.4.2安装、测试
Copyright © 2011-2022 走看看