开发者

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

开发者 https://www.devze.com 2022-12-23 22:15 出处:网络
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 tha开发者_开发问答t in interface builder?In Interface Builder, select the UIText

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 tha开发者_开发问答t in interface builder?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号