UIActivityViewController创建单独的邮件图标

时间:2013-02-27 02:22:15

标签: uiactivityviewcontroller

我正在尝试创建一个UIActivityViewController,让用户发送有关当前正在查看的网页的反馈。我想在Mail图标中有一个单独的按钮,弹出一个带有收件人集,主题集和邮件正文的撰写窗口,其中包含一些文本和当前URL(我得到的URL为:NSURL * urlStringToShare = _webView .request.URL;在RootViewController中)。任何想法如何做到这一点?谢谢你的帮助。

2 个答案:

答案 0 :(得分:1)

例如,我已经有了这样做的IBAction:

- (IBAction)showEmail:(id)sender {
    // Email Subject
    NSString *emailTitle = @"Feedback on your latest column from the GlennKessler App:";
    // Email Content
    NSString *messageBody3 = @"I disagree with your latest Fact Check and the number of pinocchios you gave. This is what I would rate it instead and why:";
    // To address
    NSArray *toRecipents = [NSArray arrayWithObject:@"blah@la.com"];

    MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
    mc.mailComposeDelegate = self;
    [mc setSubject:emailTitle];
    [mc setMessageBody:messageBody3 isHTML:NO];
    [mc setToRecipients:toRecipents];

    // Present mail view controller on screen
    [self presentViewController:mc animated:YES completion:NULL];

}

任何方式将其转换为带有图标的UIActivityViewController项目?谢谢!

答案 1 :(得分:0)

尝试使用此功能,您可以使用此链接中的库创建许多自定义活动(如邮件):

https://github.com/imulus/OWActivityViewController

相关问题