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 ...
随机推荐
- 2019西安多校联训 Day5
T1 光哥为了不让某初二奆佬恶心到我们而留下的火种 (貌似没这题平均分就100-了) 思路:就一横一竖让后就gztopa嘛 #include <bits/stdc++.h> using n ...
- 3 SQL 聚合与排序
3 聚合与排序 3-1 对表进行聚合查询 聚合函数 通过SQL对数据进行 操作或计算时需要使用函数. 计算表中全部数据行数时,可以使用COUNT函数. COUNT : 计算表中的记录数(行数). SU ...
- 交互式数据可视化-D3.js(四)形状生成器
使用JavaScript和D3.js实现数据可视化 形状生成器 线段生成器 var linePath = d3.line() - 使用默认的设置构造一个 line 生成器. linePath.x() ...
- 虚拟机如何设置静态IP
一.本机环境 Mac.VMware Fusion 10, CentOS6.8 二.设置静态IP地址 1.选择网络连接模式,选择NAT模式 注意: 1)必须要选择NAT模式,否则你的虚拟机与主机始终会在 ...
- Python 装饰器 property() 函数
描述:property() 函数的作用是在新式类中返回属性值. @property 装饰器简单理解就是负责把一个方法变成属性调用 下面理解property()方法语法: class property( ...
- [luoguP2736] “破锣摇滚”乐队 Raucous Rockers(DP)
传送门 f[i][j]表示前i首歌放到前j个盘里最多能放多首 ntr[i][j]表示i~j中最多能放进一张盘中多少首歌 ntr数组可以贪心预处理出来. #include <cstdio> ...
- hdu4352 XHXJ's LIS(数位DP + LIS + 状态压缩)
#define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire ...
- 【linux】ls与ll区别
ll是一个事先被定义好的别名(alias).别名就是赋予一条命令或者一列命令的名称.可以将别名作为缩写的同义词.在我的Ubuntu系统上,~/.bashrc文件中有这么一条语句alias ll='ls ...
- 一个开发的Linux使用心得总结
Liunx介绍 Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户.多任务.支持多线程和多CPU的操作系统.它能运行主要的UNIX工具软件.应用程序和网络协 ...
- QT程序--小工具集合
这是在大一第一学期时写的参加程序设计大赛的作品,当时参加的时候仅仅只有贪吃蛇,迷宫算法和文件加密这三个功能,而且当时的界面并没有进行任何美化,现在想起来有点可惜.然而这并不是一个只写一遍的软件,在后期 ...