2016.01.22 简单动画
2016-01-25 19:03
337 查看
简单动画没什么好说的,直接看代码。=-=
值得一提:『翻页效果』中的写法,别的都可以。
//横向、纵向移动 [UIView animateWithDuration:0.5 animations:^{ self.aView.frame = CGRectMake(_aView.frame.origin.x, _aView.frame.origin.y + 50, _aView.frame.size.width, _aView.frame.size.height); }]; //渐变效果 [UIView animateWithDuration:0.5 animations:^{ _aView.alpha = !_aView.alpha; }]; //翻页效果 [UIView beginAnimations:nil context:nil];//开始动画的配置 [UIView setAnimationDuration:0.5]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];//动画的『节奏』 [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:_aView cache:NO]; [UIView commitAnimations];//动画配置完毕,提交动画 //旋转 [UIView animateWithDuration:0.5 animations:^{ //只能做一次 // _aView.transform = CGAffineTransformMakeRotation(M_PI); //能多次 _aView.transform = CGAffineTransformRotate(_aView.transform, M_PI_4); }]; //放大效果 [UIView animateWithDuration:0.5 animations:^{ _aView.transform = CGAffineTransformMakeScale(2, 2); }]; //缩小 [UIView animateWithDuration:0.5 animations:^{ _aView.transform = CGAffineTransformScale(_aView.transform, 0.7, 0.7); }]; //平移 [UIView animateWithDuration:0.5 animations:^{ _aView.transform = CGAffineTransformTranslate(_aView.transform, 10, 10); }];
值得一提:『翻页效果』中的写法,别的都可以。
相关文章推荐
- Caffe BaseDataLayer.cpp BasePrefetchingDataLayer.cpp DataLayer.cpp 学习
- tomcat 两个端口部署应用
- 大智慧小问题
- 检测是否联网
- ORACLE触发器详解
- 基于TFS实践敏捷-可视化管理
- poj 3984 迷宫问题 宽度搜索 一个终点
- location.false(true)
- 第 1 章 Html 介绍
- .NET页面加载中
- ogr2ogr使用
- POJ3254
- js禁用按钮及解除禁用
- 连续子数组的最大和/1007. Maximum Subsequence Sum (25)
- HDU 1992
- 大量文章地址地图
- js页面跳转功能无法顺利执行可能原因
- 如何实现一个malloc
- 阅读jeecms源码总结
- 学习记录20160125