我正在分享一些内容UIActivityController
.
它适用于其他选项.
我能得到subject
并且body
在默认的邮件应用程序.
但当我用来共享内容时,gmail
我Subject
的邮件已经消失,我Body
在Gmail Subject's
部分获取内容:
这是我的代码:
NSString *body = @"I am Body"; NSString *tagLine = @"I am Subject"; NSArray *objectToShare = [NSArray arrayWithObjects:body, nil]; UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectToShare applicationActivities:nil]; [activityVC setValue:tagLine forKey:@"subject"]; NSArray *excludeActivities = @[UIActivityTypeAirDrop, UIActivityTypePrint, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, UIActivityTypeAddToReadingList, UIActivityTypePostToVimeo]; activityVC.excludedActivityTypes = excludeActivities; [self presentViewController:activityVC animated:YES completion:nil];
为了更好的图片这里是截图:
使用默认应用:
使用Gmail:
我也尝试过不同的答案.但它们都不起作用.