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. 六个比较好用的php数组Array函数

    1. array_column 返回输入数组中某个单一列的值.2. array_filter 用回调函数过滤数组中的元素.3. array_map 将用户自定义函数作用到给定数组的每个值上,返回新的值 ...

  2. CentOS7 搭建GIT环境

    一. 安装 libiconv 这个是非常规项 如果服务器原来已经装过 可以不装 但是如果git安装时候提示找不到libiconv 需要在git的安装参数中指定安装路径 最新版是 1.15 wget h ...

  3. centos7环境下ELK部署之elasticsearch

    es部署:es只能用普通用户启动 博客园首发,转载请注明出处:https://www.cnblogs.com/tzxxh/p/9435318.html 一.环境准备: 安装jdk1.8.创建普通用户 ...

  4. 转载:CSS的组成,三种样式(内联式,嵌入式,外部式),优先级

    (仅供自己备份) 原文地址:http://blog.csdn.net/chq11106004389/article/details/50515717 CSS的组成 选择符/选择器+声明(属性+值) 选 ...

  5. Leecode刷题之旅-C语言/python-206反转链表

    /* * @lc app=leetcode.cn id=206 lang=c * * [206] 反转链表 * * https://leetcode-cn.com/problems/reverse-l ...

  6. ubuntu16.04 64位安装tftp服务器

    1.安装tftpd-hpa和xinetd sudo apt-get install tftpd-hpa xined2.针对64位操作系统安装openbsd-inetd apt-get install ...

  7. go学习笔记-错误处理

    错误处理 通过内置的错误接口提供了非常简单的错误处理机制. error类型是一个接口类型 type error interface { Error() string } 可以在编码中通过实现 erro ...

  8. 成都Uber优步司机奖励政策(1月12日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  9. 创龙DSP6748开发板LED闪烁-第一篇

    1. 首先看下DSP6748的GPIO寄存器的文档,先看下框图,有这个框图,一目了然,输入和输出很清楚 2. 看下寄存器部分,对应上面的图,问题在于,DSP6748有多少个GPIO?最多144个,下一 ...

  10. linux_fdisk命令详解,关于分区的详解

    这篇文章写的十分详细,特别的好 fdisk -l 可以列出所有的分区,包括没有挂上的分区和usb设备.我一般用这个来查找需要挂载的分区的位置,比如挂上u盘. 实例解说Linux中fdisk分区使用方法 ...