共享表中的iOS样式按钮

时间:2013-05-21 06:26:34

标签: ios uiactivityviewcontroller

enter image description here

无论如何设置从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:^{}];

}

1 个答案:

答案 0 :(得分:-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];

看看这是内置的框架工作。

Override UIActivityViewController default behaviour