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的更多相关文章

  1. IOS开发-UIView之动画效果的实现方法(合集)

    http://www.cnblogs.com/GarveyCalvin/p/4193963.html 前言:在开发APP中,我们会经常使用到动画效果.使用动画可以让我们的APP更酷更炫,最重要的是优化 ...

  2. iOS 中 为UIView添加背景图片

    创建UIImage的方法有两种: UIImage *image = [UIImageimageNamed:@"image.jpg"];//这种不释放内存,要缓存 NSString ...

  3. iOS开发之 Xcode6 添加xib文件,去掉storyboard的hello world应用

    iOS开发之  Xcode6.1创建仅xib文件,无storyboard的hello world应用 由于Xcode6之后,默认创建storyboard而非xib文件,而作为初学,了解xib的加载原理 ...

  4. ios开发之UIView和UIViewController

    UIView 表示屏幕上的一块矩形区域,负责渲染区域的内容,并且响应该区域内发生的触摸事件.它在 iOS App 中占有绝对重要的地位,因为 iOS 中几乎所有可视化控件都是 UIView 的子类. ...

  5. IOS开发之UIView总结

    如果想调用某个类的某个方法可以写成这样,这个方法来自NSObject类 performSelector: performSelector:withObject: performSelector:wit ...

  6. IOS开发之UIView的基本使用

    一.视图 1. iphone手机上的窗口就是UIWindow类的一个实例(1个手机应用只有一个UIWindow). 2.UIView类用于实现视图. UIView提供了方法来添加和删除子视图.一个视图 ...

  7. iOS开发之UIView的常见属性

    1.所有控件都继承自UIView,UIView的常见属性如下: @property(nonatomic,readonly) UIView *superview;获得自己的父控件对象 @property ...

  8. iOS开发之UIView

    在iPhone里你能看到的.摸到的,都是UIView. 视图坐标系统: UIKit中的坐标都是基于这样的坐标系统:以左上角为坐标的原点,原点向下和向右为坐标轴方向. 坐标值由浮点数来表示,内容的布局和 ...

  9. ios开发之UIView的frame、bounds跟center属性的区别(附图)

    博文暂时想到什么写什么,不顺理成章,不顺章成篇. 先看几个概念 坐标点Poit:向右侧为X轴正方向的值x,原点下侧为Y轴正方向的值y 大小Size:由宽度width和高度height构成,表示一个矩形 ...

随机推荐

  1. es6 Proxy对象详解

    Proxy用于修改某些操作的默认行为,也可以理解为在目标对象之前架设一层拦截,外部所有的访问都必须先通过这层拦截,因此提供了一种机制,可以对外部的访问进行过滤和修改.这个词的原理为代理,在这里可以表示 ...

  2. Elasticsearch 索引操作

    一.创建 语法: PUT /索引库名称 { "settings": { "number_of_shards": 分片数量, "number_of_re ...

  3. 用PHP读取Excel、CSV文件

    PHP读取excel.csv文件的库有很多,但用的比较多的有: PHPOffice/PHPExcel.PHPOffice/PhpSpreadsheet,现在PHPExcel已经不再维护了,最新的一次提 ...

  4. kafka zk常用命令

    1  创建topic: kafka-topics.sh --create --zookeeper 3.3.3.3:2181 --replication-factor 1 --partitions 3 ...

  5. hadoop的自定义分组实现 (Partition机制)

    hadoop开发中我们会遇到类似这样的问题,比如 如何将不同省份的手机号分别输出到不同的文件中,本片文章将对hadoop内置的Partition类进行重写以解决这个问题. MapReduce的使用者通 ...

  6. linux进程篇 (三) 进程间的通信3 IPC通信

    3 IPC通信 用户空间 进程A <----无法通信----> 进程B -----------------|--------------------------------------|- ...

  7. linux 下安装 Cisco Packet Tracer 7.11以及一些注意

    https://blog.csdn.net/qq_35882901/article/details/77652571 https://linux.cn/article-5576-1.html 开启登录 ...

  8. Go 问题集

    删除文件后缀名,出现问题 import "strings" func changePath(file_path string) string { ) } 转换路径 /转换为\\ i ...

  9. Java设计模式(2)——创建型模式之工厂方法模式(Factory Method)

    一.概述 上一节[简单工厂模式]介绍了通过工厂创建对象以及简单的利弊分析:这一节来看看工厂方法模式对类的创建 工厂方法模式: 工厂方法与简单工厂的不同,主要体现在简单工厂的缺点的改进: 工厂类不再负责 ...

  10. web项目优化

    1 循环时没有使用break  案例:查找一个值是否在数组中存在(为举例舍弃自带函数) $aa=123; $arr=array(234,123,5,6,45646,346,23); foreach($ ...