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

前端之家收集整理的这篇文章主要介绍了ios – UIActivityViewController无法将图像添加到imessage前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用UIActivityViewController在ios 6和我的代码上共享图像
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与几乎所有介质共享.

原文链接:https://www.f2er.com/iOS/334232.html

猜你在找的iOS相关文章