Objective-C的与大型动画图片(Objective-c & large animated i

2019-07-05 02:26发布

到目前为止,我使用的UIImageView与被显示此起彼伏UIImages的阵列。

同样的临客在这个例子:

NSArray *myImages = [NSArray arrayWithObjects:
                     [UIImage imageNamed:@"instruction_1"],
                     [UIImage imageNamed:@"instruction_2"],
                     [UIImage imageNamed:@"instruction_3"],
                     [UIImage imageNamed:@"instruction_2"],
                     [UIImage imageNamed:@"instruction_1"]
                     ,nil];

UIImageView *butta = [[UIImageView alloc] initWithFrame:frame];
butta.animationImages = myImages;
butta.animationDuration = 1;
butta.animationRepeatCount = 0;
butta.alpha = 0;
[butta startAnimating];

但问题是,这种解决方案的工作,直到图像是小...但对我来说,他们大多是相同设备最大分辨率(2000宽度和高度1500的景观视网膜的iPad)... ...,它具有alpha通道(巴纽)......导致表现不佳,特别是在速度较慢的设备(甚至在iPad 3)...

你知道有什么好方法吗? 我试过.SVG显卡,但它是更坏。

如何优化呢?

在此先感谢您的帮助,关心大卫

Answer 1:

我用AVAnimator之前大获成功。 我也有类似的问题,我不得不做出非常大的图像拍成电影。 还有一点与它的学习曲线,但我相信他有无数的例子,我刚刚适应我的使用。



文章来源: Objective-c & large animated images