0

MFMailComposerViewController 在其消息正文中将 URL 显示为纯文本,而不是可点击的链接。无论如何我可以做到这一点吗?

4

3 回答 3

2

设置为 HTML 并<a href="link">The link</a>使用– setMessageBody:isHTML:. 平淡就是所谓的平淡。

于 2012-05-10T10:26:08.033 回答
1
    MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
    composer.mailComposeDelegate = self;

    [composer setMessageBody:message isHTML:YES];
    NSMutableString *body = [NSMutableString string];
    [body appendString:@"<h1>Hello User!</h1>\n"];
    [body appendString:@"<a href=\"http://www.mysite.com/path/to/link\">Click Me!</a>\n"];
    [composer setMessageBody:body isHTML:YES];

希望这对你有用。快乐编码:)

于 2012-05-10T10:35:30.090 回答
1

是的 这是可能的,你可以这样做:

MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init]; composer.mailComposeDelegate = self; 
[composer setSubject:subject]; 
[composer setMessageBody:message isHTML:YES]; 
//Message is just a NSString with HTML Content and you can have all the HTML Contents in it.
于 2012-05-10T10:41:09.657 回答