【发布时间】:2017-02-13 16:29:01
【问题描述】:
我关注这个post来展示GIF图片。
我试过了:
#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 图像不显示。
【问题讨论】:
-
@Anbu.Karthik,与我上面提到的相同链接。
-
哦,抱歉,如果你想播放单个 gif,使用 UIWebview 是最好的选择
标签: ios objective-c gif