【问题标题】:Create mailto: links with the cell of a iOS table [closed]创建mailto:与iOS表格单元格的链接[关闭]
【发布时间】:2011-10-20 21:19:16
【问题描述】:

我正在使用 Storyboard 构建一个相当简单的 Tabel View Controller,其中一些单元格将包含电子邮件地址。

如何制作这些超链接?

正如我所说,我主要使用 Storyboard 来创建这些视图,因此相应的代码是 XML 格式的。我应该把“href=mailto:”标签放在哪里?

【问题讨论】:

    标签: ios hyperlink uikit tableview


    【解决方案1】:

    你可以使用委托方法:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    

    然后确定该行中的数据,然后你会想要:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://blah"]];
    

    您也可以使用 MFMailComposeViewController。在这里阅读更多:

    http://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMailComposeViewController_class/MFMailComposeViewController_class.pdf

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-21
      • 2022-11-20
      • 1970-01-01
      • 1970-01-01
      • 2012-03-01
      • 2012-05-11
      • 1970-01-01
      相关资源
      最近更新 更多