Clickable link (Hyperlink)?

有些话、适合烂在心里 提交于 2020-01-07 04:35:09

问题


I'm sorry if this is a stupid question but I cannot find a answer. Is there a way to create a clickable link say in a MFMailComposeController or in any other NSString? I just want it to be blue and the user will be able to click it and it will go to that link.

Thanks!


回答1:


in the mail msg body try this - [mailComposer setMessageBody:msg isHTML:YES];. So when you put the message compose it of HTML & put this setting so that the mail is sent as HTML...

MFMailComposeViewController *mailComposer; 
mailComposer  = [[MFMailComposeViewController alloc] init];
mailComposer.mailComposeDelegate = self;
[mailComposer setModalPresentationStyle:UIModalPresentationFormSheet];
[mailComposer setSubject:@"Mail subject"];
[mailComposer setMessageBody:msg isHTML:YES];
[self presentModalViewController:mailComposer animated:YES];
[mailComposer release];
return;


来源:https://stackoverflow.com/questions/7021114/clickable-link-hyperlink

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!