Tom猫

作者: 任梦RM | 来源:发表于2016-03-14 19:51 被阅读21次

1.//按钮函数

- (IBAction)beginAction:(UIButton*)sender {

NSLog(@"我做动作了");

switch(sender.tag) {

case100:{

//执行核心功能模块

[selfanimationImageNmae:@"cymbal"WithAccount:13];

}break;

case101:{

[selfanimationImageNmae:@"fart"WithAccount:28];

}break;

case102:

[selfanimationImageNmae:@"eat"WithAccount:40];

break;

case103:

[selfanimationImageNmae:@"drink"WithAccount:81];

break;

case104:

[selfanimationImageNmae:@"scratch"WithAccount:56];

break;

case105:

[selfanimationImageNmae:@"pie"WithAccount:24];

break;

case106:

[selfanimationImageNmae:@"stomach"WithAccount:34];

break;

case107:

[selfanimationImageNmae:@"foot_right"WithAccount:30];

break;

case108:

[selfanimationImageNmae:@"foot_left"WithAccount:30];

break;

case109:

[selfanimationImageNmae:@"knockout"WithAccount:81];

break;

case110:

[selfanimationImageNmae:@"angry"WithAccount:26];

break;

default:

break;

}

}

2.//核心功能模块

-(void)animationImageNmae:(NSString*)name WithAccount:(int)count{

//新建数组

NSMutableArray*tempArray = [NSMutableArraynew];

//往数组里加图片

for(intindex=0;index

//找图片

NSString*imageName=[NSStringstringWithFormat:@"%@_%02d.jpg",name,index];

UIImage*image=[UIImageimageNamed:imageName];

//把图片放到数组

[tempArrayaddObject:image];

}

//把图片给图片试图

self.backImageView.animationImages=tempArray;

//设置动画的执行次数

self.backImageView.animationRepeatCount=1;

//动画的执行时间

self.backImageView.animationDuration=0.1*count;

//开始动画

[self.backImageViewstartAnimating];

}

相关文章

  • Android手机网络强弱

    Tom猫哦哦哦

  • TOM猫

    import UIKit @UIApplicationMain class AppDelegate: UIResp...

  • Tom猫

    1.//按钮函数 - (IBAction)beginAction:(UIButton*)sender { NSLo...

  • ToM猫 (UIImage )

    将上图中的Main interface 中的 Main 删掉,然后将放有照片的文件夹拖到程序中,如上图左侧。自己在...

  • Tom猫1

    -(void)viewDidLoad [super viewDidLoad];{ //序列帧动画要播放的图片数组 ...

  • TOM猫2

    精简算法 -(void)tomCatAnimationWithName:(NSString *)name /...

  • Tom-猫

  • Tom猫的动画

    今天我们来学一下tom猫的动画吧? 首先我们先找到一个tom猫的一系列动作。添加到工程中。 class AppDe...

  • __tom猫简易配置

    http://blog.csdn.net/liuyiming_/article/details/7742533

  • 薛定谔的猫

    世界上有许多著名的猫:Kitty、加菲猫、哆啦A梦、Tom……而科学界最著名的猫,大概就是“薛定谔的猫”了。薛定谔...

网友评论

    本文标题:Tom猫

    本文链接:https://www.haomeiwen.com/subject/dgbflttx.html