4つの画像を含む1つのgif画像ファイルがあります。これらの画像をUIImageビューに1行ずつ表示するのが好きですimage.animation。ガイドを教えてください私は代替を使用して表示または表示することが可能です教えてください。
ありがとうございました 。
4つの画像を含む1つのgif画像ファイルがあります。これらの画像をUIImageビューに1行ずつ表示するのが好きですimage.animation。ガイドを教えてください私は代替を使用して表示または表示することが可能です教えてください。
ありがとうございました 。
FLAnimatedImageは、iOS 向けのパフォーマンスの高いオープン ソースのアニメーション GIF エンジンです。
これは、Flipboard のすべての GIFを強化するために作成した、十分にテストされたコンポーネントです。
それはあなたを助けます、gifリンクのために..https ://github.com/mayoff/uiimage-from-animated-gifより多くの助けはお気軽にお問い合わせください
このようにしてみてください...
- (void)viewDidLoad {
[super viewDidLoad];
NSURL *url = [[NSBundle mainBundle] URLForResource:@"loading" withExtension:@"gif"];
UIImage *loadingImage = [UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:url]];
self.dataImageView.animationImages = loadingImage.images;
self.dataImageView.animationDuration = loadingImage.duration;
self.dataImageView.animationRepeatCount = 1;
self.dataImageView.image = loadingImage.images.lastObject;
[self.dataImageView startAnimating];
}
まず、これら 4 つの画像を 1 つの Plist に追加して、次のコードを実行します。うまくいくことを願っています
NSDictionary *picturesDictionary = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"PhotesArray" ofType:@"plist"]];
NSArray *imageNames = [picturesDictionary objectForKey:@"Photos"];
NSMutableArray *images = [[NSMutableArray alloc] init];
for (int i=0; i<[imageNames count]; i++) {
[images addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
}
//Normal animation
self.dataImageView.animationImages = images;
self.dataImageView.animationDuration = 3.0;
[self.dataImageView startAnimating];
はい、iOSで可能です。ここに、以下のURLを1つ含めました。
https://github.com/mayoff/uiimage-from-animated-gif
私があなたを抱いたことを願っています。