开发者

How can I make clickable links like the Twitter and Facebook app? [duplicate]

开发者 https://www.devze.com 2023-03-14 16:36 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to make an expression clickable on iOS?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to make an expression clickable on iOS?

On Twitter and Facebook, usernames like @ and hashtags like # are clickable, and do something native within t开发者_开发知识库he app.

What is the best way to implement something like this? It would be nice if there was a drop in replacement for a UILabel for example.


The TTTAttributedLabel project on github is a drop-in replacement for UILabel that supports embedding links. https://github.com/mattt/TTTAttributedLabel


I'm not sure what Twitter does, but the Facebook app uses a library called Three20 to achieve Rich Text UILabels. They have the ability to be formatted and have in-line hyperlinks. You should specifically look at TTStyledTextLabel.

Check it out: http://three20.info/

0

精彩评论

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