How to set text in a UITextView as a link to a URL

巧了我就是萌 提交于 2020-01-02 03:23:18

问题


I have some text in a UITextView, that I would like to have show as blue, and serve as a link to a website. How do I do that in interface builder?


回答1:


In Interface Builder, select the UITextView, open the inspector, go to the Text View Attributes tab, then make share "Detect Links" is checked.

This only works for items that look like links (http://stackoverflow.com)

For making arbitrary links, then you will want to use a UIWebView instead.



来源:https://stackoverflow.com/questions/2489950/how-to-set-text-in-a-uitextview-as-a-link-to-a-url

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