我有一个UIActivityViewController共享一个对象
UIActivityItemSource协议和NSURL.gif文件和CFBridgingRelease(kUTTypeGIF)相应的方法提供动画GIF文件.如果我在新邮件中共享一个对象,我会看到GIF在模拟器中移动.如果我尝试发推文相同的内容,图片的一个框架会附加到推文上,但它会作为静止图像上传.
我是否需要等待Apple UIActivityTypePostToTwitter在未来的iOS版本中更新,或者我错过了您在某处看到的解决方法?(我意识到这个案例没有使用"Twitter.com,Android和iPhone [app]"列表中的任何内容.这可能是徒劳的.)
家庭作业已经完成:
NSData对象而不是NSURL我的本地.gif文件.没变.我试图返回kUTTypeData,而不是kUTTypeGIF作为dataTypeIdentifierForActivityType在看到这个之后,Twitter的API文档:
传递的图像应该是图像或二进制base64编码的原始二进制文件,只要Content-Type设置得恰当(当有疑问时:"application/octet-stream"),就不需要编码或转义内容.
但是我的推文中没有出现任何图片.
谢谢!
twitter objective-c animated-gif ios uiactivityviewcontroller
我正试图通过标准iOS共享屏幕将我的(统一)应用程序的gif共享到社交网络.
由于这个问题,我首先将路径包装到NSURL中的gif,然后再将其发送到UIActivityViewController:
NSURL *nsGifURL = [NSURL fileURLWithPath:nsGifPath];
NSArray *itemsToShare = @[nsMessage, nsGifURL];
// find the unity window:
UIWindow *window = [UIApplication sharedApplication].keyWindow;
UIActivityViewController *share = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
[window.rootViewController presentViewController:share animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
这一切都编译并运行没有错误,但是当我到达另一个应用程序时,图像是静态的而不是gif.
如何让fb之类的应用接受并在另一端显示gif?
编辑:nsGifPath肯定有.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)