我正在使用 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。我不知道为什么?感谢您的帮助!