//

//  ViewController.m

//  UI-动画练习

//

//  Created by jzq_mac on 15/7/22.

//  Copyright (c) 2015年 jzq_mac. All rights reserved.

//

#import
"ViewController.h"

@interface
ViewController ()

{

UIImageView *animation;

UIView *view;

UIView *view1;

}

@end

@implementation ViewController

- (void)viewDidLoad {

[super
viewDidLoad];

[self
creatView];

[NSTimer
scheduledTimerWithTimeInterval
target:self
selector:@selector(creatView)
userInfo:nil
repeats:YES];

}

- (void)creatView

{

//动态图并移动动态图

animation = [[UIImageView
alloc,
,
)];

animation.layer.cornerRadius =
;

animation.layer.masksToBounds =
YES;

NSMutableArray *list = [NSMutableArray
array];

for (int i =
; i <= ; i++) {

NSString *name = [NSString
stringWithFormat:@"动态猫-%d(被拖移).tiff",i];

[list
addObject:[UIImage
imageNamed:name]];

}

animation.animationImages = list;

animation.animationDuration =
;

;

[animation
startAnimating];

[UIView
animateWithDuration
animations:^{animation.frame =
CGRectMake,
,
);}
completion:^(BOOL finishied){[UIView
animateWithDuration
animations:^{animation.frame =
CGRectMake,
);}];}];

[self.view
addSubview:animation];

//   移动视图

self.view.backgroundColor = [UIColor
grayColor];

view =[[UIView
alloc,
,
)];

view.backgroundColor = [UIColor
redColor];

view.layer.cornerRadius =
;

[self.view
addSubview:view];

[UIView
animateWithDuration
animations:^{view.frame =
CGRectMake,
,
);}
completion:^(BOOL finished){[UIView
animateWithDuration
animations:^{view.frame =
CGRectMake,
,
);}];}];

view.alpha =
;

[UIView
animateWithDuration
animations:^{view.alpha =
;}];

view1 =[[UIView
alloc,
,
)];

view1.backgroundColor = [UIColor
yellowColor];

view1.layer.cornerRadius =
;

[self.view
addSubview:view1];

view1.alpha =
;

[UIView
animateWithDuration
animations:^{view1.alpha =
;}];

[UIView
animateWithDuration
animations:^{view1.frame =
CGRectMake,
,
);}
completion:^(BOOL finished){[UIView
animateWithDuration
animations:^{view1.frame =
CGRectMake,
,
);}];}];

}

//- (void)click:(UIButton *)sender

//{

//    if (sender.selected !=YES ) {

//        sender.selected = YES;

//        [animation startAnimating];

//        [sender setTitle:@"開始" forState:UIControlStateNormal];

//

//    }else{

//        sender.selected = NO;

//        [animation stopAnimating];

//        [sender setTitle:@"暂停" forState:UIControlStateSelected];

//    }

//}

- (void)didReceiveMemoryWarning {

[super didReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

@end


iOS学习之动画效果的实现的更多相关文章

  1. iOS学习——核心动画

    iOS学习——核心动画 1.什么是核心动画 Core Animation(核心动画)是一组功能强大.效果华丽的动画API,无论在iOS系统或者在你开发的App中,都有大量应用.核心动画所在的位置如下图 ...

  2. iOS学习——核心动画之Layer基础

    iOS学习——核心动画之Layer基础 1.CALayer是什么? CALayer我们又称它叫做层.在每个UIView内部都有一个layer这样一个属性,UIView之所以能够显示,就是因为它里面有这 ...

  3. iOS酷炫动画效果合集

    iOS酷炫动画效果合集 源码地址 https://github.com/YouXianMing/Animations 效果绝对酷炫,包含了多种多样的动画类型,如POP.Easing.粒子效果等等,虽然 ...

  4. iOS的GIF动画效果实现

    引言:GIF图像格式是常见的一种动态图片格式,无论是在Web端还是在移动端都经常遇到,但是考虑目前iOS还无法原生展现GIF图片,而对于GIF的原生支持暂时也没有像JPG.PNG等图像格式支持得这么全 ...

  5. iOS 一个小动画效果-b

    近期工作不忙,来一个需求感觉棒棒的,是一个比较简单的页面,如下图(图1) 图1 应该很简单吧,没什么大的功能,就是一个展示,一个拨打电话,拨打电话不需要说,几行代码搞定,基本UI也不用说了,刚培训完的 ...

  6. ios UIView常用动画效果

    一 //调用 1 2 3 4 5 6 if(m_viewScenario.superview == nil)<br>{     m_viewScenario.alpha = 1.0;    ...

  7. ios 动画效果CATransition笔记

    初学ios开发,很多概念还不清楚,所以只有边学边做例子.又怕学了后面忘了前面,因此用自己的博客来纪录自己的学习历程,也是对自己学习不要懈怠做个监督. 刚学ios做动画效果.因为ios封装得很好,实现i ...

  8. iOS 动画效果:Core Animation & Facebook's pop

    本文转载至 http://www.cocoachina.com/ios/20151223/14739.html 感谢原创作者分享 前言相信很多人对实现 iOS 中的动画效果都特别头疼,往往懒得动手,功 ...

  9. iOS的动画效果类型及实现方法

    实现iOS漂亮的动画效果主要有两种方法, 一种是UIView层面的, 一种是使用CATransition进行更低层次的控制, 第一种是UIView,UIView方式可能在低层也是使用CATransit ...

随机推荐

  1. ios之UITableView

    今天要分享的是IOS开发中一个使用率非常高的一个控件-------UITableView,这两天正在使用tableview做信息的显示,在写代码时对tableview和tableviewcell的几种 ...

  2. ios NSRange

    Objective-C中判断字符串是否包含其他字符串 -(BOOL) hasPrefix:(NSString *) astring;检查字符串是否以astring开头:-(BOOL) hasSuffi ...

  3. 【简●解】[ZJOI2005]午餐

    [简●解][ZJOI2005]午餐 [关键词] \(DP\) 排序/贪心 [分析] 首先,一个很明显的贪心思路,就是吃的慢的人先打饭.所以把数据按吃饭时间从大到小排一遍序. 根据\(dp\)的尿性,比 ...

  4. [模板] LIS

    树状数组优化LIS到nlogn,网上找了好多,感觉讲得都不是很明白,正好自己复习整理一下. 基本的DP方程 f[i]=max(f[i],f[j]+1) (j<i且a[j]<a[i]) 定义 ...

  5. 同一SQL语句在PLSQL Developer与SQL * PLUS工具中执行结果不一致

    背景 今天遇到如下问题,同一sql语句在PLSQL Developer与SQL*PLUS工具中执行结果不一致, sql语句如下 SELECT 'GROUPHEALTH_SEND_EMAIL' as i ...

  6. IntrospectorCleanupListener监听器防止内存溢出

    <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</ ...

  7. [luoguP1849] [USACO12MAR]拖拉机Tractor(spfa)

    传送门 神奇的spfa #include <queue> #include <cstdio> #include <cstring> #include <ios ...

  8. java中filter的用法

    filter过滤器主要使用于前台向后台传递数据是的过滤操作.程度很简单就不说明了,直接给几个已经写好的代码: 一.使浏览器不缓存页面的过滤器 Java代码   import javax.servlet ...

  9. CodeForces - 743B Chloe and the sequence

    暴力肯定是无法做的 当时做的时候 当成一道递推来做的 用到分治的思想 想象一串长度为2n+1的列 那么前n个为前一串数 后n个是前一串数的reverse 第n+1个数 为第几串的编号 例如 第几串 中 ...

  10. MYSQL Explain语法

    Explain语法 EXPLAIN SELECT …… 变体: 1. EXPLAIN EXTENDED SELECT …… 将执行计划“反编译”成SELECT语句,运行SHOW WARNINGS 可得 ...