UIView动画基础
1 Position 平移
[UIView animateWithDuration:1.0 animations:^{
_blueView.centerX = self.view.width -100;
_blueView.centerY = self.view.height -150;
}];
2 Opacity 透明度
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor whiteColor];
_redView = [[UIView alloc]init];
_redView.backgroundColor = [UIColor redColor];
_redView.left = 100;
_redView.top = 100;
_redView.height = 100;
_redView.width = 100;
[self.view addSubview:_redView];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[UIView animateWithDuration:1.0 animations:^{
_redView.alpha = 0.3;
}];
}
3 Scale 尺寸
[UIView animateWithDuration:1.0 animations:^{
_yellowView.transform = CGAffineTransformMakeScale(0.3, 0.3);
}];
4 Ratation 偏移
[UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationOptionRepeat animations:^{
_grayView.transform = CGAffineTransformRotate(_grayView.transform, M_PI);
} completion:nil];
[UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse animations:^{
_blackView.left = self.view.width -_blackView.width -50;
} completion:nil];
UIViewAnimationOption
UIViewAnimationOptionLayoutSubviews //提交动画的时候布局子控件,表示子控件将和父控件一同动画。
UIViewAnimationOptionAllowUserInteraction //动画时允许用户交流,比如触摸
UIViewAnimationOptionBeginFromCurrentState //从当前状态开始动画
UIViewAnimationOptionRepeat //动画无限重复
UIViewAnimationOptionAutoreverse //执行动画回路,前提是设置动画无限重复
UIViewAnimationOptionOverrideInheritedDuration //忽略外层动画嵌套的执行时间
UIViewAnimationOptionOverrideInheritedCurve //忽略外层动画嵌套的时间变化曲线
UIViewAnimationOptionAllowAnimatedContent //通过改变属性和重绘实现动画效果,如果key没有提交动画将使用快照
UIViewAnimationOptionShowHideTransitionViews //用显隐的方式替代添加移除图层的动画效果
UIViewAnimationOptionOverrideInheritedOptions //忽略嵌套继承的选项
//时间函数曲线相关
UIViewAnimationOptionCurveEaseInOut //时间曲线函数,由慢到快
UIViewAnimationOptionCurveEaseIn //时间曲线函数,由慢到特别快
UIViewAnimationOptionCurveEaseOut //时间曲线函数,由快到慢
UIViewAnimationOptionCurveLinear //时间曲线函数,匀速
//转场动画相关的
UIViewAnimationOptionTransitionNone //无转场动画
UIViewAnimationOptionTransitionFlipFromLeft //转场从左翻转
UIViewAnimationOptionTransitionFlipFromRight //转场从右翻转
UIViewAnimationOptionTransitionCurlUp //上卷转场
UIViewAnimationOptionTransitionCurlDown //下卷转场
UIViewAnimationOptionTransitionCrossDissolve //转场交叉消失
UIViewAnimationOptionTransitionFlipFromTop //转场从上翻转
UIViewAnimationOptionTransitionFlipFromBottom //转场从下翻转
UIView动画基础的更多相关文章
- 个人学习对UIView动画的总结
我的博客之前已经开通五个月了,但是一直没有写东西.一是不敢写,二是也不知道写啥.毕竟是一个刚刚入行大半年的菜鸟,现在总想通过各种办法提高自己.之前总感觉用到一些东西,只是当时搞懂了一点,加上并没有总结 ...
- iOS动画1 — UIView动画
iOS动画基础是Core Animation核心动画.Core Animation是iOS平台上负责图形渲染与动画的基础设施.由于核心动画的实现比较复杂,苹果提供了实现简单动画的接口—UIView动画 ...
- 动画基础--基于Core Animation(3)
参考:https://zsisme.gitbooks.io/ios-/content/ 前面的文章动画基础--基于Core Animation(1),动画基础--基于Core Animation(2) ...
- 动画基础--基于Core Animation(2)
参考:https://zsisme.gitbooks.io/ios-/content/ 前面的文章动画基础--基于Core Animation(1)提到了图层的基本概念以及可动画参数几何学等知识. 本 ...
- iOS 动画基础总结篇
iOS 动画基础总结篇 动画的大体分类(个人总结可能有误) 分类.png UIView 动画 属性动画 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 ...
- iOS核心动画以及UIView动画的介绍
我们看到很多App带有绚丽狂拽的特效,别出心裁的控件设计,很大程度上提高了用户体验,在增加了实用性的同时,也赋予了app无限的生命力.这些华丽的效果很多都是基于iOS的核心动画原理实现的,本文介绍一些 ...
- 转一篇简洁的UIView动画编程方法
iOS 中的 UIView 动画编程其实还是很简单的,像 CSS3 一样,在给定的时间内完成状态连续性的变化呈现.比如背景色,Frame 大小,位移.翻转,特明度等. 以前我使用的编程方式都是用下面 ...
- iOS开发UI篇—核心动画(基础动画)
转自:http://www.cnblogs.com/wendingding/p/3801157.html 文顶顶 最怕你一生碌碌无为 还安慰自己平凡可贵 iOS开发UI篇—核心动画(基础动画) iOS ...
- UIView动画
UIView动画 一.commitAnimations方式使用UIView动画 1.commitAnimations方式使用UIView动画 [UIView beginAnimations:@&quo ...
随机推荐
- Centos7搭建ansible运维自动化工具
1)设置主机名和hosts文件 2)配置阿里云repo源 Wget -O /etc/yum.repos.d/aliyun.repo https://mirrors.aliyun.com/repo/Ce ...
- 编写who命令
第一个版本: /* who1.c - a first version of the who program * open, read UTMP file, and show results. */ # ...
- 6.3.4 使用marshal 模块操作二进制文件
Python 标准库 marshal 也可以进行对象的序列化和反序列化,下面的代码进行了简单演示. import marshal x1 = 30 x2 = 5.0 x3 = [1,2,3] x4 = ...
- SGC强制最低128位加密,公钥支持ECC加密算法的SSL证书
Pro SSL证书,验证企业域名所有权和企业身份信息,采用SGC(服务器门控)技术强制128位以上至256位加密,属于企业OV验证级专业版(Pro) SSL证书:即使用户使用低版本浏览器(比如浏览 ...
- 【codeforces 764D】Timofey and rectangles
[题目链接]:http://codeforces.com/contest/764/problem/D [题意] 给你n个矩形,以左下角坐标和右上角坐标的形式给出; (保证矩形的边长为奇数) 问你有没有 ...
- Java基础学习总结(74)——Java常见笔试题及答案汇总
1. 下面哪些是合法的标识符?(ABE )--标识符 A. $persons B. TwoUsers C. *point D. this E. _endline 2. 下面程序运行的结果是( D )- ...
- ssh_整合总结
开场白:首先,我先帮大家整理一下思路 准备: 数据库,表,数据 jar 包准备 Hibernate 基本jar 包 C3p0 数据库连接池 Spring AOP 基本包 Spring Ioc 基本包 ...
- ESdata节点脱离集群,系统日志报120秒超时
ES信息:Centos7.2,ES6.2.2 , MASTER:16核/128G物理 * 3 ,DATA:16核/128G/12块HDD6T组成RAID0 * 40, JVM开了30G, 目前只有一 ...
- Flume安装部署
Flume安装部署 Flume的安装(非常简单) 上传安装包到数据源所在节点上,实际上不是数据源节点也是可以的,只要运行Flume的这台机器与数据源节点的这台机器能够通过某种协议进行通信即可. 然后解 ...
- Android:创建ZeroMQ的客户端
这里我们将给出一个subscribe模式的客户端示例程序,如下: private class ZeroMQMessageTask extends AsyncTask<String, Void, ...