开发者

UITextView: Change formatting of URLs?

I currently have a UITextView which has this property setup to detect URL's:

txtTemp.dataDetectorTypes = UIDataDetectorTypeLink;

The URL displays correctly, formatting in blue with an underline.

I want to change the formattin开发者_如何学JAVAg of this hyperlink to a bold font style with no underline. The rest of the regular text in the UITextView needs to stay the same.

Can someone please tell me how to do this?


I'm afraid you can't change the appearance of links in textviews. Textviews generally don't support text formatting of any kind.

If the content doesn't need to be edited by the user, consider using UIWebView.

You'll need to do a little bit more work to set it up, but it allows you to format your content using html and css, giving you a lot of text formatting options.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜