欧美三区_成人在线免费观看视频_欧美极品少妇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网 | 国产成人免费无庶挡视频 | 人妻熟女久久久久久久 | 91视频视频| 国产成人精品三级 | 亚洲经典在线中文字幕 | 天天天天操 | 亚洲综合区| 国产精品无码永久免费888 | 免费黄色欧美视频 | 中文字幕一区二区三 | 免费人成年短视频在线观看免费网站 | 欧美一级h | 一级做a爰片久久毛片 | 欧美人两个人激情的免费视频 | 欧美调教视频 | 久久3 | 午夜男人女人爽爽爽视频 | 精品免费视频 | 国产九色在线 | 欧美精品一区二区三区在线 | 亚洲国产欧美在线观看 | 奇米影视8888狠狠狠狠 | 天天干网 | 青娱乐在线免费 | 草草视频在线 | 91.成人天堂一区 | 国产在线毛片 | 欧美激情久久欧美激情 | 日本高清www无色夜在 | 久操久操 | 广西美女一级毛片 | 久久视屏这里只有精品6国产 | 中文字幕一区二区三区四区不卡 | 欧美精品99久久久久久人 | 狠狠干伊人网 | 久草手机在线视频 | 欧美综合亚洲 | 毛片啪啪啪 | 日本三级带日本三级带黄国产 |