湯姆貓

//

//? ViewController.m

//? TOM

//

//? Created by lanou on 16/7/12.

//? Copyright?2016年lanou. All rights reserved.

//

#import"ViewController.h"

@interfaceViewController()

@property(weak,nonatomic)IBOutletUIImageView*TomCatView;

@end

@implementationViewController

- (void)viewDidLoad {

[superviewDidLoad];

//? ? UIImageView *imageView = [UIImageView new];

//序列幀動(dòng)畫要播放的圖片數(shù)組

//? ? ? imageView.animationImages

//動(dòng)畫時(shí)長(zhǎng)

//? ? imageView.animationDuration

//動(dòng)畫重復(fù)次數(shù)

//? ? imageView.animationRepeatCount

//開始動(dòng)畫

//? ? [imageView startAnimating];

//結(jié)束動(dòng)畫

//? ? [imageView stopAnimating];

//是否正在執(zhí)行動(dòng)畫

//? ? [imageView isAnimating]'

}

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

NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <40; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"eat_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=40*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)drinkaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <81; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"drink_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=81*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)knockoutaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <81; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"knockout_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=81*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)Tompieaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <24; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"pie_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=24*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)qiaoluoaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <13; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"Cymbal_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=13*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)Tomfartaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <28; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"fart_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=28*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)scratchaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <56; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"scratch_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=56*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)angryaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <26; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"angry_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=26*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)sromachaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <34; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"stomach_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=34*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)rightatcion:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <30; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"footright_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=30*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (IBAction)leftaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];

//創(chuàng)建可變數(shù)組images,負(fù)責(zé)存放要播放的圖片數(shù)組

for(NSIntegeri =0; i <30; i++) {

//根據(jù)I來加載圖片,添加到可變數(shù)組IMAGES里面、

//格式化圖片

NSString*imageName = [NSStringstringWithFormat:@"footleft_%02ld.jpg",i];

//根據(jù)格式化的圖片名加載圖片image

UIImage*image = [UIImageimageNamed:imageName];

//將圖片image添加到數(shù)組images中

[imagesaddObject:image];

}

//設(shè)置動(dòng)畫圖片數(shù)組

self.TomCatView.animationImages= images;

//設(shè)置動(dòng)畫時(shí)長(zhǎng)

self.TomCatView.animationDuration=30*0.075;

//重復(fù)次數(shù)

self.TomCatView.animationRepeatCount=1;

//開始動(dòng)畫

[self.TomCatViewstartAnimating];

}

- (void)didReceiveMemoryWarning {

[superdidReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

@end


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容