gpt4 book ai didi

ios - UIActivityViewController 无法将图像添加到 imessage

转载 作者:可可西里 更新时间:2023-11-01 03:19:54 25 4
gpt4 key购买 nike

我在 ios 6 和我的代码中使用 UIActivityViewController 分享图像

        UIImage *shareImage = [UIImage imageNamed:@"myImage.png"];

// Init array
NSMutableArray *items = [NSMutableArray new];
[items addObject:@""];
[items addObject:shareImage];

// Add image to paste board
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.persistent = YES;
pasteboard.image = shareImage;

UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:items applicationActivities:nil];

//This is an array of excluded activities to appear on the UIActivityViewController
activityVC.excludedActivityTypes = @[UIActivityTypePostToWeibo,
UIActivityTypePrint,
UIActivityTypeCopyToPasteboard,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll];

[self presentViewController:activityVC animated:TRUE completion:nil];

一切正常,但无法将 shareImage 粘贴到 iMessage。我不知道为什么?感谢您的帮助!

最佳答案

正如其他人所说,iMessage 仅支持文本,不支持图像。虽然在 iOS7 中听起来很像,但确实有效。

我个人知道我已经让它与 OvershareKit 一起工作:https://github.com/overshare/overshare-kit .

它当然会增加一些开销,但允许您与几乎所有具有灵活界面/API 的媒体共享。

关于ios - UIActivityViewController 无法将图像添加到 imessage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15656271/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com