UIActivityViewController共享UIActivity未显示

时间:2013-01-04 14:37:02

标签: iphone uiactivityviewcontroller uiactivity

我正在使用UIActivityViewController进行相机胶卷图片分享:

UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityController animated:YES completion:nil];

如果我没有设置Facebook和Twitter设置,我找不到来自UIActivityViewController的Facebook,Twitter,消息活动。

有人说用户应首先配置Facebook和Twitter设置,但我可以在配置FB,Twitter设置之前从Apple相机应用程序图像共享UIActivityViewController中找到这些活动。 而且无论如何我都看不到消息活动。

如何让它发挥作用?

1 个答案:

答案 0 :(得分:0)

请尝试UIActionSheet

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Share your photo" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Email",@"Facebook",@"Twitter",@"Instagram",@"Save to Photo Library",nil];
 [actionSheet showInView:self.view];

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if(buttonIndex == 0){
      //for Email in code above
    }
}