iphone - 如何在 iPhone 应用程序中使用动画 .gif?

标签 iphone graphics

我有一个 gif 动画文件,想在 iPhone 应用程序中使用,但该动画不起作用。有谁知道如何解决吗?

最佳答案

如果您想要为一系列图像添加动画效果,您可以使用 UIImageView 轻松实现:

UIImage *blur5 = [UIImage imageNamed:@"blur5.png"];
UIImage *blur6 = [UIImage imageNamed:@"blur6.png"];

self.imageView.animationImages = [[NSArray alloc] initWithObjects:blur5, blur6, nil];
self.imageView.animationRepeatCount = 5;
[self.imageView startAnimating];

我发现这比尝试使用 UIWebView 更容易。

关于iphone - 如何在 iPhone 应用程序中使用动画 .gif?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/661108/

相关文章:

javascript - 位置权限警报使用 Phonegap 显示两次

iphone - 为什么 viewDidLoad 中的 self.navigationController 为 null?

C# Graphics.DrawString 不渲染特殊字符?

iphone - 阻止发布版本崩溃

iphone - 在 Ant 脚本中添加 xcodeuild 的build设置

android - 如何在android上创建烟花粒子图形效果

C++ OpenGL : How to make a second circle over the cylinder?

Android 位图每像素分配 16 BYTES

c# - 在多个系统上运行图形显示,保持同步

ios - 如何向用户请求联系人权限以访问然后建立和打开联系人?