如何将动画GIF写入iOS相机胶卷? [英] How to write animated GIF to iOS camera roll?

查看:113
本文介绍了如何将动画GIF写入iOS相机胶卷?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将动画GIF写入iOS相机胶卷?我了解照片库应用无法播放动画,但例如我应该能够在发送电子邮件等时导入它。

How do you write an animated GIF to the iOS camera roll? I understand that the photo gallery app is not able to play animations, but for example I should be able to import it when sending an email, etc.

我试过了:

UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:self.imageData], nil, nil, nil);

但这似乎将其转换为jpg。

But this seems to convert it to a jpg.

推荐答案

创建 ALAssetLibrary 实例。将此方法与 NSData 一起使用: writeImageDataToSavedPhotosAlbum:metadata:completionBlock:

Create an ALAssetLibrary instance. Use this method with your NSData: writeImageDataToSavedPhotosAlbum:metadata:completionBlock:

参考

这篇关于如何将动画GIF写入iOS相机胶卷?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆