如何在动作表中显示本机共享图标

时间:2014-04-25 09:29:46

标签: ios objective-c ios7

在iOS 7中,我想分享一些与之类似的行动表:

enter image description here

我的代码是:

NSString *textToShare = @"your text";
UIImage *imageToShare = [UIImage imageNamed:@"yourImage.png"];
NSArray *itemsToShare = @[textToShare, imageToShare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll]; //or whichever you don't need
[self presentViewController:activityVC animated:YES completion:nil];

但我这样空白:

enter image description here

0 个答案:

没有答案