相关疑难解决方法(0)

iOS分享GIF(动画图片)无效

已经差不多2天了,我正在寻找解决我的问题但我没有成功,我想在Facebook,Twitter,电子邮件,WhatsApp上使用"UIActivityViewController"分享GIF(动画图像).

这是我的代码:

NSURL *imagePath = [NSURL URLWithString:@"http://sth.gif"];
NSData *animatedGif = [NSData dataWithContentsOfURL:imagePath];

NSArray *sharingItems = [NSArray arrayWithObjects: animatedGif,stringToShare, nil];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
Run Code Online (Sandbox Code Playgroud)

当我分享电子邮件时,它的动画和它的工作完美,但在Twitter,Facebook,whatsApp Gifs没有动画,它就像一个图像......我已经阅读了所有关于相同问题的堆栈溢出问题像这样这样或者这样但是它不适合我.

twitter facebook objective-c gif ios

6
推荐指数
1
解决办法
2879
查看次数

如何在iOS中分享gif动画图像

我不知道如何使用UIActivityViewController分享动画.gif图像.请帮我解决这个问题.谢谢提前

see this image .i am displaying this type of images and to share these images I am using uiactivity view but it is not animating .it's just displaying image 



if(imgFrameCount==1)

    {
        imgFrameCount++;
        NSURL *url1=[[NSBundle mainBundle]URLForResource:@"animated2" withExtension:@"gif"];
        self.firstImage=[UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:url1]];
        self.frameImage.image = self.firstImage;
    }
else if (imgFrameCount==2)
{
    imgFrameCount++;
    NSURL *url2=[[NSBundle mainBundle]URLForResource:@"animated3" withExtension:@"gif"];
    self.firstImage=[UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:url2]];
    self.frameImage.image = self.firstImage;
}
Run Code Online (Sandbox Code Playgroud)

ios

2
推荐指数
1
解决办法
2936
查看次数

标签 统计

ios ×2

facebook ×1

gif ×1

objective-c ×1

twitter ×1