//

//  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


最新文章

  1. Linux &amp; Systemd 挂载问题解决
  2. Github 新的项目管理模式——Projects
  3. python file 文件读写
  4. CAST和CONVERT差别与联系
  5. form表单中的enctype属性什么意思?
  6. Spring事务管理中@Transactional的propagation参数
  7. 如何调用EcStore中的API接口
  8. C语言库函数大全及应用实例五
  9. sns社交系统ThinkSNS+ 更新至V0.8.2,新增圈子功能
  10. MongoDB基础介绍安装与使用
  11. mysql字符设置
  12. 201621123068 Week02-Java基本语法与类库
  13. RENAME方法进行分区改造
  14. 如何使用Android Studio把自己的Android library分享到jCenter和Maven Central
  15. poj1733(带权并查集+离散化)
  16. ES6 Proxy的应用场景
  17. python判断结构总结
  18. 浏览器是怎样工作的:渲染引擎,HTML解析
  19. 通过ffplay实现摄像头preview
  20. attr全选第三次失效

热门文章

  1. 倍增实现LCA
  2. springmvc请求小例子
  3. mysql数据库中的索引有那些、有什么用
  4. idea 设置系列 各种乱码
  5. springmvc ajax传值详解
  6. Python+selenium(定位一组元素)
  7. 【HDOJ6333】Harvest of Apples(莫队)
  8. 字符串常量与const常量内存区(——选自陈皓的博客)
  9. SQL SERVER 2012 第四章 连接 JOIN の OUTER JOIN,完全连接FULL JOIN,交叉连接CROSS JOIN
  10. 从零开始写STL—functional