IOS MFMailComposeViewController链接a href未单击
我有个问题 我的链接是HTML,我可以看到“蓝色”,但如果我点击它,就不会打开safari mobile。允许我编辑文本 在一个班级里,我有:IOS MFMailComposeViewController链接a href未单击,ios,href,mfmailcomposeviewcontroller,Ios,Href,Mfmailcomposeviewcontroller,我有个问题 我的链接是HTML,我可以看到“蓝色”,但如果我点击它,就不会打开safari mobile。允许我编辑文本 在一个班级里,我有: if ([MFMailComposeViewController canSendMail]) { self.mailComposeDelegate = self; [self setSubject: @"Subject"]; [self setMessageBody: @"<h
if ([MFMailComposeViewController canSendMail]) {
self.mailComposeDelegate = self;
[self setSubject: @"Subject"];
[self setMessageBody: @"<h2>Body</h2><a href='http://www.google.com'>link example</a>" isHTML: YES];
}
if([MFMailComposeViewController canSendMail]){
self.mailComposeDelegate=self;
[自我设置主体:@“主体”];
[self-setMessageBody:@“Body”isHTML:YES];
}
试试这个:
<a href=\"http://www.google.com">link example</a>
编辑:
请尝试以下工作代码:
messageBody = [NSString stringWithFormat:@"<a href:\"\nhttps://www.google.com\">\nhttps://www.google.com</a>"];
messageBody=[NSString stringWithFormat:@”“;
邮件生成器中的链接不起作用。当用户查看收到的电子邮件时,该链接起作用。@rmaddy 10x you man:)您需要在NSString
中转义两个双引号。但是使用单引号没有错。这不是问题。@Houssamhammud请看编辑后的答案,还有一件事,当您打开Mail composer时,它将不起作用,当此邮件打开表单sent Mail Box时,它将起作用OK 10x man当我收到电子邮件时,a href工作得非常好:)@Houssamhammud最好:)@rmaddy是的,我在之前的评论中已经向他指出了这一点,你可以查一下。