0

enter image description here

Is there anyway to style the buttons for the Mail sheet created from a UIActivityViewController

Share screen is called via this code

-(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:^{}];

}
Nick
  • 1,315
  • 9
  • 16

1 Answers1

-1

try with this

        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];

see this for inbuilt frame work.

Override UIActivityViewController default behaviour

Community
  • 1
  • 1
SAMIR RATHOD
  • 3,512
  • 1
  • 20
  • 45
  • thanks, I think. I'm not creating this window my self though, it appears after selecting 'mail' from the UIActivityViewController , where would I put this code? – Nick May 21 '13 at 08:28
  • write this on button click – SAMIR RATHOD May 21 '13 at 09:17
  • but as I said, I'm not dealing with the button click, it's come from UIActivityViewController, can you not use the appeareanceWhenContainedIn proxy somehow? – Nick May 21 '13 at 09:22
  • I'm not, I'm using UIActivityViewController – Nick May 21 '13 at 10:09
  • yes, but you have to Override UIActivityViewController behaviour. oR write my code with one button click. – SAMIR RATHOD May 21 '13 at 10:16