开发者

TTStyledText that recognizes URLs without http:// scheme

I am using TTStyledText to display text with potential markup on a TTStyledTextLabel.

If text contains something like "http://stackoverflow.com" TTStyledText autogenerates the m开发者_如何转开发arkup and linkifies said text.

The problem is I also want "www.stackoverflow.com" to appear as valid hyperlinks, as well as anything that reasonably resembles an http URL, even if the scheme is missing.

Any way to do that with TTStyleText or do I need to recognize the URL and reformat the text myself?


I've always found TTStyledText to be woefully underpowered and missing a lot of functionality. This is a good example. I think in order to make this work you'll need to as you say pre-format the text portion before you pass it in.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜