码迷,mamicode.com
首页 > 其他好文 > 详细

UIImageView

时间:2016-02-21 09:04:19      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    
    UIView *containerView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    containerView.backgroundColor = [UIColor whiteColor];
    [self.window addSubview:containerView];
    [containerView release];
    //做动态图
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 375, 667)];
    
    //指定展示图片
//    imageView.image = [UIImage imageNamed:@"angry_00.jpg"];
    NSMutableArray *mArr = [NSMutableArray arrayWithCapacity:0];
    for (int i = 0; i < 10; i++) {
        //获取图片名称
        NSString *picStr = [NSString stringWithFormat:@"btn_%02d.jpg",i];
        //获取每一张图片对象
        UIImage *image = [UIImage imageNamed:picStr];
        [mArr addObject:image];
    }
    //指定做动画的所有图片
    imageView.animationImages = mArr;
    
    //指定动画时间,动画重复次数
    imageView.animationDuration = 11 * 0.05;
    imageView.animationRepeatCount = 0;
    
    [imageView startAnimating];//开启动画
    [containerView addSubview:imageView];
    [imageView release];
     [self.window makeKeyAndVisible];
    return YES;
}

UIImageView

标签:

原文地址:http://www.cnblogs.com/networkprivaate/p/5204396.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!