我曾嘗試:
#import "ViewController.h"
@interface ViewController()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
animatedImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"splash.gif"], nil];
animatedImageView.animationDuration = 6.0f;
animatedImageView.animationRepeatCount = 10;
[animatedImageView startAnimating];
[self.view addSubview: animatedImageView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
我添加的GIF圖片到我的項目。但GIF圖像不顯示。
看到這個曾經http://stackoverflow.com/questions/4386675/add-animated-gif-image-in-iphone-uiimageview –
@ Anbu.Karthik,在同一條鏈路我提到的上方。 – Khuong
噢好吧對不起,如果你想玩的單個gif使用UIWebview是最好的選擇 –