iOS开发给UIView添加动画Animation
self.testView需要添加动画的view
1.翻转动画
[UIView beginAnimations:@"doflip" context:nil];
[UIView setAnimationDuration:];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.testView cache:YES];
[UIView commitAnimations];
2.旋转动画
CGAffineTransform transform;
transform = CGAffineTransformRotate(self.testView.transform, M_PI / 6.0);
[UIView beginAnimations:@"rotate" context:nil];
[UIView setAnimationDuration:];
[UIView setAnimationDelegate:self];
[self.testView setTransform:transform];
[UIView commitAnimations];
3.偏移动画
[UIView beginAnimations:@"move" context:nil];
[UIView setAnimationDuration:];
[UIView setAnimationDelegate:self];
self.testView.frame=CGRectMake(,, ,);
[UIView commitAnimations];
4.翻页效果
[UIView beginAnimations:@"curlUp" context:nil];
[UIView setAnimationDuration:];
//设置动画淡入淡出
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
self.testView.frame=CGRectMake(,, ,);
//设置翻页的方向
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.testView cache:YES];
[UIView commitAnimations];
5.缩放效果
CGAffineTransform transform;
transform = CGAffineTransformScale(self.testView.transform,1.2,1.2);
[UIView beginAnimations:@"scale" context:nil];
[UIView setAnimationDuration:];
[UIView setAnimationDelegate:self];
[self.testView setTransform:transform];
[UIView commitAnimations];
6.取反效果
CGAffineTransform transform;
transform=CGAffineTransformInvert(self.testView.transform);
[UIView beginAnimations:@"Invert" context:nil];
[UIView setAnimationDuration:];//动画时常
[UIView setAnimationDelegate:self];
[self.testView setTransform:transform];//获取改变后的view的transform
[UIView commitAnimations];//关闭动画
iOS开发给UIView添加动画Animation的更多相关文章
- IOS开发-UIView之动画效果的实现方法(合集)
http://www.cnblogs.com/GarveyCalvin/p/4193963.html 前言:在开发APP中,我们会经常使用到动画效果.使用动画可以让我们的APP更酷更炫,最重要的是优化 ...
- iOS 中 为UIView添加背景图片
创建UIImage的方法有两种: UIImage *image = [UIImageimageNamed:@"image.jpg"];//这种不释放内存,要缓存 NSString ...
- iOS开发之 Xcode6 添加xib文件,去掉storyboard的hello world应用
iOS开发之 Xcode6.1创建仅xib文件,无storyboard的hello world应用 由于Xcode6之后,默认创建storyboard而非xib文件,而作为初学,了解xib的加载原理 ...
- ios开发之UIView和UIViewController
UIView 表示屏幕上的一块矩形区域,负责渲染区域的内容,并且响应该区域内发生的触摸事件.它在 iOS App 中占有绝对重要的地位,因为 iOS 中几乎所有可视化控件都是 UIView 的子类. ...
- IOS开发之UIView总结
如果想调用某个类的某个方法可以写成这样,这个方法来自NSObject类 performSelector: performSelector:withObject: performSelector:wit ...
- IOS开发之UIView的基本使用
一.视图 1. iphone手机上的窗口就是UIWindow类的一个实例(1个手机应用只有一个UIWindow). 2.UIView类用于实现视图. UIView提供了方法来添加和删除子视图.一个视图 ...
- iOS开发之UIView的常见属性
1.所有控件都继承自UIView,UIView的常见属性如下: @property(nonatomic,readonly) UIView *superview;获得自己的父控件对象 @property ...
- iOS开发之UIView
在iPhone里你能看到的.摸到的,都是UIView. 视图坐标系统: UIKit中的坐标都是基于这样的坐标系统:以左上角为坐标的原点,原点向下和向右为坐标轴方向. 坐标值由浮点数来表示,内容的布局和 ...
- ios开发之UIView的frame、bounds跟center属性的区别(附图)
博文暂时想到什么写什么,不顺理成章,不顺章成篇. 先看几个概念 坐标点Poit:向右侧为X轴正方向的值x,原点下侧为Y轴正方向的值y 大小Size:由宽度width和高度height构成,表示一个矩形 ...
随机推荐
- 爬虫-scrapy五大核心组件及工作流
- 使用bison和yacc制作脚本语言(3)
我们现在已经可以写好文法了,下一步我们打算开始正式创建工程了 在工程目录下,我们创建如下文件夹 ./include ./memory ./ms include文件夹下我们将放头文件 memory是内存 ...
- VIM Commands
Vim Commands Commands in NORMAL modes Motions small granular: move by direction k h l j mid granular ...
- AMD,CMD,CommonJs,UMD讲解
一.CommonJS CommonJS规范加载模块是同步的,只有加载完成,才能执行后面的操作 CommonJS规范中的module.exports和require 每个文件就是一个模块,有自己的作用域 ...
- nmap教程(上)
一.nmap的主要功能 1.端口扫描 2.主机探测:查找目标网络的在线主机 3.服务/版本检测:发现开放端口后,进一步检测目标主机的检测服务协议.应用程序名称.版本号等信息 4.操作系统检测 5.网络 ...
- SVN的使用——下载、安装
今天我们来学习一下如何使用SVN(Subversion) 既然要使用SVN那么我们就先来认识一下SVN.SVN的全名是Subversion,它是一个自由,开源的版本控制系统.在Subversion管理 ...
- Netty示例
一,服务端 ** * 测试Netty类库:服务端代码 * Created by LiuHuiChao on 2016/10/24. */ public class NettyServerTest { ...
- CakePHP中回调函数的使用
我们知道模型主要是用来处理数据的,有时我们想在模型操作之前或之后做一些额外逻辑处理,这时候就可以使用回调函数. 回调函数有很多种,beforeFind,afterFind,beforeValidate ...
- leetcode--笔记8 Fizz Buzz
题目要求: Write a program that outputs the string representation of numbers from 1 to n. But for multipl ...
- 从golang的垃圾回收说起(上篇)
本文来自网易云社区 1 垃圾回收中的重要概念 1.1 定义 In computer science, garbage collection (GC) is a form of automatic me ...