我有一个 UIActivityViewController 不会关闭 iPad 上的邮件对话框。该代码是来自 Apple 示例的标准代码,并且在 iPhone 上运行良好。
NSString* someText = [NSString stringWithFormat:@"%@ Is really cool, sent from Element Story. en.wikipedia.info/wiki/%@",
[_detailItem description], [_detailItem description]];
ActivityViewCustomProvider *customProvider =
[[ActivityViewCustomProvider alloc]init];
NSArray *items = [NSArray arrayWithObjects:customProvider,imageView.image,someText, nil];
//ActivityViewCustomActivity *ca = [[ActivityViewCustomActivity alloc]init];
// ...or whatever pieces of data you want to share.
UIActivityViewController *activityVC =
[[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
//applicationActivities:[NSArray arrayWithObject:ca]];
activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypePrint, UIActivityTypeCopyToPasteboard];
[self presentViewController:activityVC animated:YES completion:^{}];