0

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

4

2 回答 2

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 项目?谢谢!

于 2013-02-27T03:01:44.787 回答
0

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

https://github.com/imulus/OWActivityViewController

于 2014-06-03T06:07:40.913 回答