【发布时间】:2015-10-22 17:44:43
【问题描述】:
Gif 在模拟器上运行流畅,但由于内存问题在设备中崩溃。如何处理这个。我用谷歌搜索了很多,但没有找到任何解决方案。
以下是我用来加载 Gif 的代码
NSURL *url = [[NSBundle mainBundle] URLForResource:[utility getString] withExtension:@"gif"];
self.img.image = [UIImage animatedImageWithAnimatedGIFURL:url];
提前致谢
【问题讨论】:
-
您是否将其加载到 webview 中?或者你有一系列加载到 imageview 中的 uiimage?
-
我将这个库用于 gif,效果很好。 github.com/rs/SDWebImage
-
@gottlieb 以下是我用来加载 Gif NSURL *url = [[NSBundle mainBundle] URLForResource:[utility getString] withExtension:@"gif"]; self.img.image = [UIImage animatedImageWithAnimatedGIFURL:url];
标签: ios objective-c image gif