开发者

UIlabel which can detect clickable text or urls

How to implement a UiLabel which can implement clickable text and 开发者_开发技巧urls, i need this to use in a twitter application


Try using a UIWebView and use the delegate to deal with clicks.

NSString *html = @"<html><head><body><a href="http://www.apple.com>Click me</a></html>";  
[webView loadHTMLString:html baseURL:nil];

You could also use a UIButton with no borders.


You mean a clickable UILabel that behaves like a UIButton?

Make a new class that is descendant of UILabel and enalbe the userInteractionEnabled to get touch events.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜