【代码笔记】iOS-等待动画
来源:互联网 发布:手机隐蔽录像软件 编辑:程序博客网 时间:2024/05/21 12:44
一,效果图。
二,工程图。
三,代码。
RootViewController.h
#import <UIKit/UIKit.h>@interface RootViewController : UIViewController{ NSTimer *timerWait; int j;}@end
RootViewController.m
#import "RootViewController.h"@interface RootViewController ()@end@implementation RootViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self;}- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //初始化背景图 [self initBackGroundView]; }#pragma -mark -functions//初始化背景图-(void)initBackGroundView{ UIImageView *waitView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 200, 130, 160)]; waitView.tag = 103; [waitView setImage:[UIImage imageNamed:@"wait1.png"]]; [self.view addSubview:waitView]; timerWait = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(wait) userInfo:nil repeats:YES];}//等待函数- (void)wait{ UIImageView *imageView = (UIImageView *)[self.view viewWithTag:103]; if (j%4 == 0) { [imageView setImage:[UIImage imageNamed:@"wait1.png"]]; }else if(j%11 == 0){ [imageView setImage:[UIImage imageNamed:@"wait4.png"]]; }else if(j%17 == 0){ imageView.frame = CGRectMake(-10, 215, 170, 145); [imageView setImage:[UIImage imageNamed:@"wait3.png"]]; }else{ [imageView setImage:[UIImage imageNamed:@"wait2.png"]]; } j++;}- (void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}
0 0
- 【代码笔记】iOS-等待动画
- 【代码笔记】iOS-浇花动画
- 【代码笔记】iOS-拍照动画
- 【代码笔记】iOS-Transition动画
- IOS开发学习笔记-(3) 进度条、等待动画开始停止
- iOS 自定义加载等待动画
- 【代码笔记】iOS-在导航栏中显示等待对话框
- 【代码笔记】iOS-伸缩式动画
- 【代码笔记】iOS-字体抖动动画
- 【代码笔记】iOS-动画的跳转
- iOS 一个带动画的等待指示器
- iOS动画效果的等待提示
- 【代码笔记】iOS-点击cell时候的动画翻转
- iOS动画纯代码
- 动画代码笔记
- iOS动画技术笔记
- 【iOS动画技术笔记】
- iOS图形动画笔记
- HTML结构文档中那些基础又重要又容易被忽略的事?
- Android:网络:图片查看器
- 裸辞后,想转行是不是没戏?
- 基于keystone 项目的Openstack API 学习笔记
- 新公司的开始以及一个小创新业务的介绍
- 【代码笔记】iOS-等待动画
- firefox正常显示,IE8,9不显示问题的解决
- 2015.12.29~2015.12.30真题回顾!-- HTML5学堂
- 151219ExtendsDemo
- Android 应用架构概述 (转)
- 让 Toolbar 随着 RecyclerView 的滚动而显示/隐藏(Part 1)
- 关于VS2010 rcxdti.dll is unable to load rcxdtiui.dll加载失败问题的解决方案
- NOVA 创建虚拟机流程
- 怎么增加C盘空间大小,教你如何调整C盘容量【图文教程 无损数据】