想要将 gif 图像从我的应用程序复制到应用程序内邮件窗口。我该怎么做?
我在这里遇到一些困惑...
我如何为我的 iPhone 应用程序显示 gif? (我的意思是我找到了各种各样的文章,但每个教程都没有完整的解决方案)
有很多解决方案我很困惑。
我应该使用在线工具将 gif 分割成不同的帧,然后使用动画将其显示在 UIImageView 中吗?
或者我应该将 gif 显示到 UIWebview 中?
或者我应该使用这篇文章吗? http://blog.stijnspijker。 nl/2009/07/animated-and-transparent-gifs-for-iphone-made-easy/
这篇文章相当不错,但它剪切了其余的帧,使图像变小在尺寸上。此外,我无法知道它是如何工作的,所以我不知道帧被剪切的原因。
请注意,在显示 gif 后,我想复制 gif,然后将其粘贴到我的应用内邮件窗口中。
需要帮助请。谢谢!
I am having some confusion here...
how do i display gif for my iPhone app?
(I mean there are various articles which i found, but every tutorial just didn't have a complete solution)
There are many solutions between which i am confused.
Should i split gif into different frames using an online tool and then display it in UIImageView using animation?
Or should i display gif into a UIWebview?
Or should i use this article?
http://blog.stijnspijker.nl/2009/07/animated-and-transparent-gifs-for-iphone-made-easy/
This article is pretty nice but it cuts the rest of the frames making the image smaller in size. Moreover, i am not able to know how its working so i dont know the reason of frames getting cut.
Please note that after i display the gif, i want to copy the gif and then paste it in my in-app mail window.
Need help plz. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIWebView 是 UIKit 中最大的内存消耗者,应尽可能避免。将 gif 转换为一系列 png 文件并使用 UIImageView 和动画图像序列显示它是最好的选择。
但要在邮件窗口中使用它,您还必须保留 gif。现在,您想要如何插入它取决于您希望它是附件还是 html img。我建议第二个选项,并将 gif 托管在网上某处,然后执行以下操作:
如果您想将其添加为附件:
UIWebView is a the biggest memory-hog in UIKit and should be avoided whenever possible. Converting gif to series of png files and displaying it using UIImageView with animated image sequence is best you can do.
But to use it in the mail window, you would have to keep the gif too. Now how you want to insert it depends on if you want it to be an attachment or a html img. I would suggest the second option, and hosting the gif somewhere online, then doing:
And if you want to add it as attachment: