//

//  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. mysql 建表规范

    常用字段 CREATE TABLE `che`.`<table_name>` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '索引id', ...

  2. Mysql 参数优化

  3. ARM Linux 3.x的设备树(Device Tree)(转)

    http://blog.csdn.net/21cnbao/article/details/8457546

  4. Objective-C-------(1)创建并使用对象

    #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { ...

  5. 激活windows10(已更新工具)

    激活windows10 1.用cmd命令: 自己动手,KMS激活win10 2016 长期服务版.步骤如下:命令提示符(管理员),依次输入以下3条命令 slmgr /ipk DCPHK-NFMTC-H ...

  6. Oracle の ty_str_split + MySQL の proc_split

    oracle实现字符串分割 功能描述:用指定分隔符切割输入的字符串,返回一维数组,每个数组元素为一个子串. ); CREATE OR REPLACE FUNCTION fn_split (p_str ...

  7. 【06】Firebug记录Javascript日志

    Firebug记录Javascript日志 你可以使用Firebug来生成日志. 这有助于我们调试web页面并发现页面的错误. 在Firefox浏览器中执行以下代码: <!DOCTYPE HTM ...

  8. 使用 wsgiref 创建WSGI APP

    wsgify装饰器将一个普通函数转变成WSGI应用程序. class webob.dec.wsgify(func=None, RequestClass=None, args=(), kwargs=No ...

  9. Codeforces 892 A.Greed

    A. Greed time limit per test 2 seconds memory limit per test 256 megabytes input standard input outp ...

  10. hdu 2181暴搜

    #include<stdio.h> #include<string.h> #define N 30 int map[N][4],total; void dfs(int n,in ...