【问题标题】:Swift iOS Facebook SDK: How to share an animated GIF?Swift iOS Facebook SDK:如何分享动画 GIF?
【发布时间】:2018-10-13 00:38:27
【问题描述】:

我想要发布到 Facebook 的 gif 文件的文档目录路径,但不幸的是,当我使用此过程时,它发布的是静态图像而不是动画。我知道它是动画的,因为我可以将相同的图像保存到我的相机胶卷并看到它动画。是否有发布此 GIF 的动画版本?

let image = UIImage(contentsOfFile: path) // document directory path

let sharePhoto = FBSDKSharePhoto()
sharePhoto.image = image

let content = FBSDKSharePhotoContent()
content.photos = [sharePhoto]

let shareDialog: FBSDKShareDialog = FBSDKShareDialog()
shareDialog.shareContent = content
shareDialog.mode = .native
shareDialog.show()

【问题讨论】:

    标签: ios swift animated-gif facebook-sdk-4.0


    【解决方案1】:

    这不是你的图片的问题,因为Facebook本身不支持gif直接上传的图片。

    您可以在Facebook 上分享gif 图像链接,它会在那里显示gif 图像。就像人们通常使用giphytenor 网站并从该网站分享 gif 图像链接一样。所以 gif 图像通过这种类型的网站显示。

    希望对你有帮助。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-26
    • 2014-01-12
    相关资源
    最近更新 更多