Iactivityviewcontroller中添加Facebo

Iactivityviewcontroller中添加Facebo

本文介绍了如何在UIactivityviewcontroller中添加Facebook,Twitter,邮件,消息图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已将activityviewcontroller添加到主控制器

Have added activityviewcontroller to the main controller

-(void)ActionSheet2:(id)sender
{
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] init];

activityViewController.excludedActivityTypes = @[UIActivityTypePostToWeibo, UIActivityTypeAssignToContact ];

[self presentViewController:activityViewController animated:YES completion:NULL];

[activityViewController release];
}

当我点击actionsheet按钮时,它显示空白的activityviewcontroller,只有取消按钮。我现在如何在activityviewcontroller中添加Facebook,Twitter,电子邮件和iMessage作为共享服务。

When i hit actionsheet button it shows blank activityviewcontroller with only cancel button. How can i now add Facebook, twitter, email and iMessage as share services in activityviewcontroller.

感谢您的帮助。

推荐答案

     //Include an array of things being attached to the ActivityViewController
     //The Array cannot be nil, you must provide something. Either an image or text or both
      NSArray *activityItems = @[@"Hello",[UIImage imageNamed:@"someImage"]];
      UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
      activityViewController.excludedActivityTypes = @[UIActivityTypePostToWeibo, UIActivityTypeAssignToContact ];
       [self presentViewController:activityViewController animated:YES completion:NULL];
       [activityViewController release];

这篇关于如何在UIactivityviewcontroller中添加Facebook,Twitter,邮件,消息图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 04:05