我想显示一个 gif,所以我所做的是拆分我的 gif,并使用此链接在 UIImageView 的动画中显示它。
http://iphonenativeapp.blogspot.com/2011/03/how-to-show-animation-in-iphoneipad-app.html
现在,我想让用户复制那个 gif 并将其粘贴到邮件应用程序中。
如果我使用包含所有 gif 拆分图像的数组,那么 4-5 张图像会粘贴到邮件应用程序中。
请帮我贴一下动图。谢谢!
最佳答案
要从 similar question 复制/粘贴我自己的答案.
NSString *gifPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"volleyball.gif"];
NSData *gifData = [[NSData alloc] initWithContentsOfFile:gifPath];
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
[pasteboard setData:gifData forPasteboardType:@"com.compuserve.gif"];
[gifData release];
编辑刚刚注意到您自己问了这 2 个类似的问题。
关于ios - 想使用 UIPasteBoard 将 gif 粘贴到邮件窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6982492/