我有点卡住这个问题。我有一个带有37张图像的UIImageView动画,其中展示了一个装满酒精的玻璃杯。 我初始化我的图像阵列中的viewDidLoad,UIImageView animateImages延迟
NSArray * GlassAnim = [[NSArray alloc] initWithObjects:
[UIImage imageWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"SodaPour1" ofType:@"png"]],
[UIImage imageWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"SodaPour39" ofType:@"png"]],
nil];
imgGlass.animationImages = GlassAnim;
imgGlass.animationDuration = 2.5;
imgGlass.contentMode = UIViewContentModeScaleAspectFit;
imgGlass.animationRepeatCount=1;
[GlassAnim release];
然后我打电话startAnimating当用户点击屏幕。但问题是动画第一次延迟了半秒。每个图片的尺寸为330 * 372像素,文件大小为180KB png文件。除了播放视频之外,还有更好的方法吗?
谢谢。
一个提示。你可以使用较短的形式为UIImage:'[UIImage imageNamed:@“SodaPour18.png”]' – Cyprian
没有可观的变化。有没有办法使用CALayer动画来做这件事?... –
Mods不会根据用户的请求回答问题,因此标记主持人的注意力不会奏效。如果你想为你的问题留下一些注意,我会高度建议你1)[编辑](http://stackoverflow.com/posts/6762408/edit)你的问题,使你的代码适合而不会导致滚动条出现(你*认真*不需要所有那些该死的UIIMage线;削减其中的大部分,缩短剩下的并将它们移动到左边),然后2)对您的问题进行奖励。你可以在[faq#bounty]中阅读赏金。祝你好运。 – Will