如何获取UITextView中电子邮件链接的点击事件?

发布于 2024-12-22 19:34:57 字数 361 浏览 4 评论 0 原文

我是 iPhone 开发新手。我正在做一个联系我们页面。这里我使用 UITextView 来显示详细信息。其中有一个电子邮件地址链接([电子邮件受保护])。当用户点击电子邮件链接时,需要显示 iPhone 的默认邮件应用程序。但我不知道如何获取UITextView中电子邮件链接的点击事件。

我怎样才能做到这一点?

我知道如何加载邮件应用程序。但在此之前我想做一些其他的事情。那么,当用户点击 UITextView 中的电子邮件链接时,如何获取点击事件?

I am new in iPhone development. I am doing a contact us page. Here I uses a UITextView to display the details. In it, there is a email address link ([email protected]). When a user tapped on the email link, the iPhone's default mail app needs to be appear. But I don't know how to get the click event of the email link in UITextView.

How can I achieve this ?.

I know how to load mail app. But before that I want to do some other things. So how can i get a click event when user taps on the email link in UITextView ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡写薰衣草的香 2024-12-29 19:34:57

iOS SDK 不会在 UITextView 中公开此事件。如果您想拦截电子邮件链接上的点击,则必须使用 UIWebView 而不是文本视图。

The iOS SDK does not expose this event in a UITextView. If you want to intercept a tap on an email link, you will have to use a UIWebView instead of the text view.

铁轨上的流浪者 2024-12-29 19:34:57

您可以在 html 内容中使用 uiwebview 来尝试此 a href="mailto:[电子邮件受保护]">

you can do it with uiwebview in your html content try this <a href="mailto:[email protected]">

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文