如何在UITextView中插入超链接?
我想插入一个超链接,就像我们在 uiwebview 中一样。由于链接显示为“阅读更多”,当用户单击它时,它必须重定向到 iPhone 浏览器(即 safari)中的 URL。
请不要建议我使用 UIwebview 来代替它。并且不要建议我
textView.dataDetectorTypes = UIDataDetectorTypeLink;
因为在第二种方式中,网址显示给用户,这是我不想要的。
给我任何其他建议来实现此目的或任何示例代码。
I want to insert a hyperlink as we have in uiwebview. As the link displayed as Read More and when user click on it then it must be redirected to a URL in iPhone browser (i.e safari).
Please don't suggest me using UIwebview in place of it. And don't suggest me
textView.dataDetectorTypes = UIDataDetectorTypeLink;
Because in second way the url displayed to the user, which I don't want.
Give me any other suggestions to achieve this or any sample code for it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它必须是一个textView吗?我做了一些类似的添加一个带有文本、背景不可见的按钮,并添加了单击时调用 safari 的操作,如下所示:
Is it have to be a textView? I did some similar adding a button with the text, background invisible and add the action to call safari on click, like this: