iPhone:识别电话号码/电子邮件时如何控制 UITextView 的链接颜色?

发布于 2024-08-05 09:23:14 字数 81 浏览 1 评论 0原文

我有一个 UITextview,里面有一个电话号码。我看到当它检测到它时,它会将标准链接变成蓝色并加下划线。我只想知道如何以编程方式控制该链接状态。

I have a UITextview that has a phone number in it. I see when it detects it it turns it the standard link blue and underlines it. I just want to know how I can control that link state programmatically.

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

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

发布评论

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

评论(1

茶花眉 2024-08-12 09:23:14

如果你想阻止 UITextView 将电话号码转换为链接,你可以这样做:

[textView setDataDetectorTypes:UIDataDetectorTypeNone];

If you want to keep the UITextView from converting the phone numbers to links, you can do this:

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