【发布时间】:2012-05-18 21:50:42
【问题描述】:
MFMailComposerViewController 在其消息正文中将 URL 显示为纯文本,而不是可点击的链接。无论如何我可以做到这一点吗?
【问题讨论】:
-
在你的问题中添加你的代码行
标签: iphone ios xcode cocoa-touch ios4
MFMailComposerViewController 在其消息正文中将 URL 显示为纯文本,而不是可点击的链接。无论如何我可以做到这一点吗?
【问题讨论】:
标签: iphone ios xcode cocoa-touch ios4
使用– setMessageBody:isHTML: 设置为带有<a href="link">The link</a> 的HTML。平淡就是所谓的平淡。
【讨论】:
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];
希望这对你有用。快乐编码:)
【讨论】:
是的,这是可能的,你可以这样做:
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.
【讨论】: