我正在尝试创建一个启动动画,但这会占用大量空间。使我的应用程序大小达到50mb并在内存中产生巨大的镜头,达到288mb并在运行应用程序时保持在那里。
因此动画包含90个这样的图像:
-(UIImageView *) InitImageView{
CGRect rect = CGRectMake(0, 0, 320, 568);
UIImageView *imageView =[[UIImageView alloc] initWithFrame:rect];
imageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"Comp 2_00000.png"], [UIImage imageNamed:@"Comp 2_00001.png"], [UIImage imageNamed:@"Comp 2_00002.png"], [UIImage imageNamed:@"Comp 2_00003.png"], [UIImage imageNamed:@"Comp 2_00004.png"], [UIImage imageNamed:@"Comp 2_00005.png"], [UIImage imageNamed:@"Comp 2_00006.png"], [UIImage imageNamed:@"Comp 2_00007.png"], [UIImage imageNamed:@"Comp 2_00008.png"], [UIImage imageNamed:@"Comp 2_00009.png"], [UIImage imageNamed:@"Comp 2_00010.png"], [UIImage imageNamed:@"Comp 2_00011.png"], [UIImage imageNamed:@"Comp 2_00012.png"], [UIImage imageNamed:@"Comp 2_00013.png"], [UIImage imageNamed:@"Comp 2_00014.png"], [UIImage imageNamed:@"Comp 2_00015.png"], [UIImage imageNamed:@"Comp 2_00016.png"], [UIImage imageNamed:@"Comp 2_00017.png"], [UIImage imageNamed:@"Comp 2_00018.png"], [UIImage imageNamed:@"Comp 2_00019.png"], [UIImage imageNamed:@"Comp 2_00020.png"], [UIImage imageNamed:@"Comp 2_00021.png"], [UIImage imageNamed:@"Comp 2_00022.png"], [UIImage imageNamed:@"Comp 2_00023.png"], [UIImage imageNamed:@"Comp 2_00024.png"], [UIImage imageNamed:@"Comp 2_00025.png"], [UIImage imageNamed:@"Comp 2_00026.png"], [UIImage imageNamed:@"Comp 2_00027.png"], [UIImage imageNamed:@"Comp 2_00028.png"], [UIImage imageNamed:@"Comp 2_00029.png"], [UIImage imageNamed:@"Comp 2_00030.png"], [UIImage imageNamed:@"Comp 2_00031.png"], [UIImage imageNamed:@"Comp 2_00032.png"], [UIImage imageNamed:@"Comp 2_00033.png"], [UIImage imageNamed:@"Comp 2_00034.png"], [UIImage imageNamed:@"Comp 2_00035.png"], [UIImage imageNamed:@"Comp 2_00036.png"], [UIImage imageNamed:@"Comp 2_00037.png"], [UIImage imageNamed:@"Comp 2_00038.png"], [UIImage imageNamed:@"Comp 2_00039.png"], [UIImage imageNamed:@"Comp 2_00040.png"], [UIImage imageNamed:@"Comp 2_00041.png"], [UIImage imageNamed:@"Comp 2_00042.png"], [UIImage imageNamed:@"Comp 2_00043.png"], [UIImage imageNamed:@"Comp 2_00044.png"], [UIImage imageNamed:@"Comp 2_00045.png"], [UIImage imageNamed:@"Comp 2_00046.png"], [UIImage imageNamed:@"Comp 2_00047.png"], [UIImage imageNamed:@"Comp 2_00048.png"], [UIImage imageNamed:@"Comp 2_00049.png"], [UIImage imageNamed:@"Comp 2_00050.png"], [UIImage imageNamed:@"Comp 2_00051.png"], [UIImage imageNamed:@"Comp 2_00052.png"], [UIImage imageNamed:@"Comp 2_00053.png"], [UIImage imageNamed:@"Comp 2_00054.png"], [UIImage imageNamed:@"Comp 2_00055.png"], [UIImage imageNamed:@"Comp 2_00056.png"], [UIImage imageNamed:@"Comp 2_00057.png"], [UIImage imageNamed:@"Comp 2_00058.png"], [UIImage imageNamed:@"Comp 2_00059.png"], [UIImage imageNamed:@"Comp 2_00060.png"], [UIImage imageNamed:@"Comp 2_00061.png"], [UIImage imageNamed:@"Comp 2_00062.png"], [UIImage imageNamed:@"Comp 2_00063.png"], [UIImage imageNamed:@"Comp 2_00064.png"], [UIImage imageNamed:@"Comp 2_00065.png"], [UIImage imageNamed:@"Comp 2_00066.png"], [UIImage imageNamed:@"Comp 2_00067.png"], [UIImage imageNamed:@"Comp 2_00068.png"], [UIImage imageNamed:@"Comp 2_00069.png"], [UIImage imageNamed:@"Comp 2_00070.png"], [UIImage imageNamed:@"Comp 2_00071.png"], [UIImage imageNamed:@"Comp 2_00072.png"], [UIImage imageNamed:@"Comp 2_00073.png"], [UIImage imageNamed:@"Comp 2_00074.png"], [UIImage imageNamed:@"Comp 2_00075.png"], [UIImage imageNamed:@"Comp 2_00076.png"], [UIImage imageNamed:@"Comp 2_00077.png"], [UIImage imageNamed:@"Comp 2_00078.png"], [UIImage imageNamed:@"Comp 2_00079.png"], [UIImage imageNamed:@"Comp 2_00080.png"], [UIImage imageNamed:@"Comp 2_00081.png"], [UIImage imageNamed:@"Comp 2_00082.png"], [UIImage imageNamed:@"Comp 2_00083.png"], [UIImage imageNamed:@"Comp 2_00084.png"], [UIImage imageNamed:@"Comp 2_00085.png"], [UIImage imageNamed:@"Comp 2_00086.png"], [UIImage imageNamed:@"Comp 2_00087.png"], [UIImage imageNamed:@"Comp 2_00088.png"], [UIImage imageNamed:@"Comp 2_00089.png"], nil];
//imageView.animationDuration = 6;
imageView.animationRepeatCount = 1;
[self.view addSubview:imageView];
return imageView;
}
每个图像的显示尺寸为640像素×1136像素。分辨率为72像素/英寸。
我可以使用哪些方法优化此启动动画以使用iPhone 4,5和6/6 +?
例如: