确实的UIImageView缓存图像? [英] Does UIImageView cache images?

查看:136
本文介绍了确实的UIImageView缓存图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我会问这问了其他人同样的问题(但它没有响应):结果<一个href=\"http://stackoverflow.com/questions/6893931/speed-up-first-uiimageview-animation-force-cache-the-images\">Speed UP第一的UIImageView动画(强制高速缓存图像)搜索结果
但是,我的短期问题是:结果
我有60张图片资源,在时间间隔内环路我会动态显示图像,每次从种源设置为 UIImageView.image 第n 图片。结果结果
现在的问题是:第一个动画是坏的!当我再次循环中的所有图像相同的UIImageView,动画是完美的。我们可以pre缓存图像的UIImageView?搜索结果
编辑:或也许我们可以做一些技巧,使动画流畅

Probably I'm gonna ask the same question which was asked by other person (But it has no responses):
Speed up first UIImageView animation (force cache the images)

But, My short question is:
I have 60 images in resources, in timeinterval loop I'm gonna animate that images, each time setting to UIImageView.image the n'th image from resouce.

The problem is: first animation is bad! When I loop all images again in same UIImageView, animation is perfect. Can we pre cache images in UIImageView?

Or maybe we can make some tricks, to make animation smooth?

推荐答案

的方法
[UIImage的imageNamed:@]
 缓存图像。所述的UIImageView没有。我用了很多崩溃了由于内存不足,图像的应用程序出现了问题。
要解决,如果我改成 [UIImage的imageWithContentsOfFile:@]。不缓存图片

要pre-缓存,你可以简单地调用图像 [UIImage的imageNamed:@] 您在init方法希望所有的图像。但是,如果你收到一个内存警告图像会被释放。

To pre-cache the image you can simply call [UIImage imageNamed:@""] for all images you want in the init method. But if you receive a memory warning the images gonna be deallocated.

这篇关于确实的UIImageView缓存图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆