iOS学习之动画效果的实现
//
// 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学习之动画效果的实现的更多相关文章
- iOS学习——核心动画
iOS学习——核心动画 1.什么是核心动画 Core Animation(核心动画)是一组功能强大.效果华丽的动画API,无论在iOS系统或者在你开发的App中,都有大量应用.核心动画所在的位置如下图 ...
- iOS学习——核心动画之Layer基础
iOS学习——核心动画之Layer基础 1.CALayer是什么? CALayer我们又称它叫做层.在每个UIView内部都有一个layer这样一个属性,UIView之所以能够显示,就是因为它里面有这 ...
- iOS酷炫动画效果合集
iOS酷炫动画效果合集 源码地址 https://github.com/YouXianMing/Animations 效果绝对酷炫,包含了多种多样的动画类型,如POP.Easing.粒子效果等等,虽然 ...
- iOS的GIF动画效果实现
引言:GIF图像格式是常见的一种动态图片格式,无论是在Web端还是在移动端都经常遇到,但是考虑目前iOS还无法原生展现GIF图片,而对于GIF的原生支持暂时也没有像JPG.PNG等图像格式支持得这么全 ...
- iOS 一个小动画效果-b
近期工作不忙,来一个需求感觉棒棒的,是一个比较简单的页面,如下图(图1) 图1 应该很简单吧,没什么大的功能,就是一个展示,一个拨打电话,拨打电话不需要说,几行代码搞定,基本UI也不用说了,刚培训完的 ...
- ios UIView常用动画效果
一 //调用 1 2 3 4 5 6 if(m_viewScenario.superview == nil)<br>{ m_viewScenario.alpha = 1.0; ...
- ios 动画效果CATransition笔记
初学ios开发,很多概念还不清楚,所以只有边学边做例子.又怕学了后面忘了前面,因此用自己的博客来纪录自己的学习历程,也是对自己学习不要懈怠做个监督. 刚学ios做动画效果.因为ios封装得很好,实现i ...
- iOS 动画效果:Core Animation & Facebook's pop
本文转载至 http://www.cocoachina.com/ios/20151223/14739.html 感谢原创作者分享 前言相信很多人对实现 iOS 中的动画效果都特别头疼,往往懒得动手,功 ...
- iOS的动画效果类型及实现方法
实现iOS漂亮的动画效果主要有两种方法, 一种是UIView层面的, 一种是使用CATransition进行更低层次的控制, 第一种是UIView,UIView方式可能在低层也是使用CATransit ...
随机推荐
- 整理几个牛人博客以及OJ
Blogs 陈立杰(wjmzbmr):http://wjmzbmr.com/ 飘过的小牛:http://blog.csdn.net/niushuai666 王垠:http://www.yinwang. ...
- [LOJ] 分块九题 4
https://loj.ac/problem/6280 区间修改,区间求和. 本来线段树的活. //Stay foolish,stay hungry,stay young,stay simple #i ...
- MySQL连接使用及分类
SQL连接 SQL 连接(JOIN)子句用于将数据库中两个或者两个以上表中的记录组合起来.连接通过共有值将不同表中的字段组合在一起. 考虑下面两个表,(a)CUSTOMERS 表:+----+---- ...
- 利用system-config-kickstart实现半自动化安装
老司机开车了… 上车请坐稳… centos7系统 首先确认已经安装了system-config-kickstart包,如果没有安装就yum install system-config-kickstar ...
- Linux 命令学习(1): head和tail
版权声明:本文为博主原创文章,未经允许,不得转载. head head 命令可以将一段文本的开头一部分输出到标准输出. head命令既可以处理文本文件也可以处理标准输入. 基本应用 处理文本文件: h ...
- Linux中vim编辑器常用命令
移动光标 Ctrl+f:屏幕向下移动一页,相当于[Page Down]按键Ctrl+b:屏幕向上移动一页,相当与[PageUp]按键 0或功能键[Home]:数字‘0’:移动到这一行的最前面的字符处$ ...
- STM32--TIM定时器时钟分割(疑难)
不太明白 (1) TIM_Perscaler来设置预分频系数: (2) TIM_ClockDivision来设置时钟分割(时钟分频因子): (3) TIM_C ...
- SpringMVC的删除功能
Dao层 package net.roseindia.dao; import java.util.Date; import java.util.List; import net.roseindia.m ...
- python +selenium 自带case +生成报告的模板
https://github.com/huahuijay/python-selenium2这个就是 python +selenium的 里面还自带case 然后也有生成报告的模板 我的: https: ...
- 可拔插的 IOC 容器
可拔插的 IOC 容器 于是我打算自己实现一个这样的 bean 容器. 但在实现之前又想到一个 feature: 不如把实现 bean 容器的方案交给使用者选择,可以选择使用 bean 容器,也可以就 ...