我有一系列图片。我想将这些图像转换为动画gif图像。 请给我一些建议。这是我的代码:
NSMutableArray *imgAry =[[NSMutableArray alloc]init];
for(int i =0 ;i<arrFiles.count-7;i++){
[imgAry addObject:[arrImageCache objectAtIndex:i]];
}
NSLog(@"%@",imgAry);
UIActivityViewController * activities = [[UIActivityViewController alloc]
initWithActivityItems:imgAry
applicationActivities:nil];
activities.excludedActivityTypes = [NSArray arrayWithObjects:, nil];
[self presentViewController:activities
animated:YES
completion:nil];
imgAry的Nslog是
(
"<UIImage: 0xd082f60>",
"<UIImage: 0xd083540>",
"<UIImage: 0xd06af80>"
)
答案 0 :(得分:1)
我不相信你需要活动控制器,有一种方法可以在UIImageView中为一系列图像制作动画,它看起来像gif。
例如,
NSMutableArray *Imgarray = [[NSMutableArray alloc]init];
for(int i=0;i<[Imgarray count];i++)
{
[array addObject:[UIImage imageNamed:[NSString stringWithFormat:@"myGiffImaf%d.png",i]]];
}
self.imageView.animationImages = Imgarray;
self.imageView.animationDuration = 3.0;
[self.imageView startAnimating];
答案 1 :(得分:-1)