0

在此处输入图像描述

无论如何都要为从UIActivityViewController

通过此代码调用共享屏幕

-(void)shareLink:(id)sender{

Post *post = [self.linkViewItems objectAtIndex:self.swipedPath.row];

NSMutableString *txt = [[NSMutableString alloc] init];
[txt appendString:[post description]];
[txt appendString:@"  "];
[txt appendString:[post href]];

NSString* someText = txt;
NSArray* dataToShare = @[someText];  // ...or whatever pieces of data you want to share.

UIActivityViewController* activityViewController =
[[UIActivityViewController alloc] initWithActivityItems:dataToShare
                                  applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:^{}];

}
4

1 回答 1

-1

试试这个

        MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        picker.mailComposeDelegate = self;


        [[picker navigationBar] setTintColor:[UIColor clearColor]];//You can set your colour
        UIImage *image1 = [UIImage imageNamed: @"bg_header.png"];
        UIImageView * iv = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,42)];
        iv.image = image1;
        iv.contentMode = UIViewContentModeCenter;
        [[[picker viewControllers] lastObject] navigationItem].titleView = iv;
        [[picker navigationBar] sendSubviewToBack:iv];
        [iv release];
        [self presentViewController:picker animated:NO completion:nil];
        [picker release];

看到这个内置的框架工作。

覆盖 UIActivityViewController 默认行为

于 2013-05-21T07:18:58.983 回答