欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

TomCat(demo15.03.15)

系統 1916 0
      //
//  ViewController.m
//  TomCat
//
//  Created by xin on 15-3-15.
//  Copyright (c) 2015年 Jackey. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *tom;

@end

@implementation ViewController

//-(UIImageView *)tom{
//    if (_tom==nil) {
//        [_tom setAnimationRepeatCount:1];
//        [_tom setAnimationDuration:0.075];
//    }
//    return _tom;
//}

-(void)tomAnimation:(NSString *)imagePrefix count:(int)count{
    
    if ([self.tom isAnimating])
        return;
    
    
    NSMutableArray *array = [NSMutableArray array];
    
    for(int i=0;i<count;i++){
        NSString *imageName = [NSString stringWithFormat:@"%@_%02d.jpg",imagePrefix,i];
        //UIImage *image = [UIImage imageNamed:imageName];
        //imageNamed 適用于小圖片 這里的情況,需要使用大量的圖片占用很多內存
        NSString *path = [[NSBundle mainBundle] pathForResource:imageName ofType:nil];
        UIImage *image = [UIImage imageWithContentsOfFile:path];
        [array addObject:image];
    }
    
    [self.tom setAnimationImages:array];
    [self.tom setAnimationDuration:array.count*0.075];
    [self.tom setAnimationRepeatCount:1];
    [self.tom startAnimating];
    
    //釋放內存
    //[self performSelector:@selector(clearTom) withObject:nil afterDelay:self.tom.animationDuration];
    [self.tom performSelector:@selector(setAnimationImages:) withObject:nil afterDelay:self.tom.animationDuration];
    
}
//-(void)clearTom{
//    self.tom.animationImages = nil;
//}

- (IBAction)headKnockOut {
    [self tomAnimation:@"knockout" count:81];
}

- (IBAction)drink {
    [self tomAnimation:@"drink" count:81];
}


@end

    

可以采取另外一種方式去拿到圖片,但是圖片拉進項目的時候應該選擇reference的方式

      //try the file way, but the images file should be referenced
    NSString *bundlePath = [[[NSBundle mainBundle]bundlePath]stringByAppendingPathComponent:@"Animations"];
    NSString *animPath = [bundlePath stringByAppendingPathComponent:imagePrefix];
    NSArray *files = [[NSFileManager defaultManager]contentsOfDirectoryAtPath:animPath error:nil];

    for(NSString *fileName in files){
        NSString *filePath = [NSString stringWithFormat:@"%@/%@",animPath,fileName];
        UIImage *image = [UIImage imageNamed:fileName];
        [array addObject:image];
    }

    

TomCat(demo15.03.15)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日本最色网站 | 色亚洲视频 | 精品国产一区探花在线观看 | 亚洲精品久中文字幕 | 欧美三级欧美一级 | 日韩在线观看免费 | 国产这里有精品 | A片人人澡C片人人大片 | 久久久精品视频免费观看 | 国产成人综合一区二区三区 | 一区二区三区国产免费 | www.蜜臀| 九九色综合网 | 在线亚洲一区二区 | 久久久久久久影院 | 久草手机在线播放 | 日韩精品 电影一区 亚洲 | 欧美精品黄页在线观看大全 | 国产一级视频 | 一级在线观看 | 国产专区视频 | 伊人艹 | 日本永久视频 | 日产精品卡二卡三卡四卡乱码视频 | 精品国产一区在线观看 | 色噜噜狠狠色综合久 | 欧美精品1区 | 久久免费福利 | 精品国产一区二区三区免费 | 欧美日韩中文在线 | 欧美日韩精品在线观看 | 首页亚洲国产丝袜长腿综合 | 亚洲人成免费网站 | 最新日本中文字幕在线观看 | 刑事侦缉档案1 | 一区二区三区毛A片特级 | 亚洲午夜网站 | 成人激情四射 | a级片免费视频 | 玖玖在线免费视频 | 久久亚洲精品玖玖玖玖 |