2016.01.22 简单动画

简单动画没什么好说的,直接看代码。=-=

//横向、纵向移动
    [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);
    }];

  值得一提:『翻页效果』中的写法,别的都可以。

时间: 2024-08-02 11:02:25

2016.01.22 简单动画的相关文章

[官方软件] Easy Sysprep v4.3.29.602 【系统封装部署利器】(2016.01.22)--skyfree大神

[官方软件] Easy Sysprep v4.3.29.602 [系统封装部署利器](2016.01.22) Skyfree 发表于 2016-1-22 13:55:55 https://www.itsk.com/forum.php?mod=viewthread&tid=362766&highlight=Easy%2BSysprep [官方软件] Easy Sysprep v4.3.29.602 [系统封装部署利器](2016.01.22) [Easy Sysprep]概述:Easy Sy

2016.01.22 单例模式(Singleton)

单例模式:整个程序的一个类只能有一个实例对象:(UIApplication.NSUserDefaults等都是IOS中的系统单例) 1.物理设备 eg:打印机 2.不可多个同时存在的资源 eg:数据库 单例的写法: 这是第一种,也是最简单.最常用的一种: 1 #import "FileOpration.h" 2 3 static FileOpration *instance = nil; //静态变量,从定义开始到整个程序结束 4 5 @implementation FileOprat

[2016.01.22]万峰文本处理专家 v2.1

<万峰文本处理专家>是一款简单易用,且功能强大的各类文本文件处理软件.1.支持多任务的处理模式,允许一次处理多个任务.2.支持正则表达式替换,替换更加强大:3.支持各类关键字的行处理操作:4.支持各类起始关键字和结束关键字的行的处理操作:5.多线程任务管理,速度快,性能稳定.6.文本替换专家作者十年磨一剑之力作. 淘宝购买地址:http://item.taobao.com/item.htm?spm=0.0.0.0.0W6h2V&id=520620878928

个人快捷键配置备忘-2016.01.22

1 Visual Studio 2010 头文件和源文件切换:  Alt+F1 在VA助手中查看 注释: Ctrl+K,Ctrl+C  (先按下Ctrl,然后依次按K,C) 取消注释: Ctrl+K,Ctrl+U 快速跳转定义: F1 向前导航: Alt+1  向后导航: Alt+2 删除行: Shift+Delete 2 Eclipse

自定义实现ExpandableListView收缩的简单动画效果

以下是 ExpandableListView 收缩的简单动画效果 1 /* 2 * Copyright (C) 2014 Gary Guo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the L

2016.01.18-2016.01.21盲审通关修改

请以上同学在1月21日(星期四)之前将以下材料交到研究生科: 1.装订好的硕士学位论文3本(注意:封面上作者姓名和指导教师隐去.致谢隐去.硕士学位期间发表的全部的论文作者隐去): 2.普通信封上写明评阅费:200元.邮寄费:22元,并将相应的钱款分别装入以上三个信封(普通信封,一共:200*3+22*3元): 3.从研究生管理信息系统中导出的“论文评阅书”封面上的作者姓名和指导教师姓名隐去:交三份“论文评阅书”和三份“学位论文评阅聘书”. 4.交三份“EMS”信封和一个装有20×3=60元邮寄费

Javascript学习------top/left简单动画,效果与jquery的动画差不多

在网上查看jquery的动画帧率为13毫秒 我用下面的小例子验证了一下: 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>top/left简单动画</title> 5 <style type="text/css"> 6 * { margin: 0px; padding: 0px; } 7 </style> 8 <script src="http:

ios animate简单动画体验

/* ===手势===== 一. 1.UISwipeGestureRecognizer 实例化一个手势 initWithTarget 2.set手势滑向方向 3.self.view 添加这个手势实例 4.添加事件 二. 轻点击 UITapGestureRecognizer .numberOfTouchesRequire 手指数 .numberOfTapsRequire 点击数 [  requireGestureRecognizerToFail:] 事件冲突执行哪一个 1 2 UISwipeGes

“耐撕”团队 2016.3.22 站立会议

时间:2016.03.22 ① :18:00--18:25   ②18:40--19:00   总计45分钟. 成员: Z 郑蕊 * 组长 (博客:http://www.cnblogs.com/zhengrui0452/), P 濮成林(博客:http://www.cnblogs.com/charliePU/), Q 齐嘉亮(博客:http://www.cnblogs.com/dendroaspis-polylepis/), L  刘伟硕(博客:http://www.cnblogs.com/We