How to implement a UiLabel which can implement clickable text and urls, i need this to use in a twitter application
+1
A:
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.
willcodejavaforfood
2010-07-20 13:51:19
I have a table view in which the cell have text that contains multiple clickable data,so UIWebView wont help, i need a Uilabel.
TechThirsty
2010-07-20 14:16:12
Not sure I understand why that would not work, care to enlighten me?
willcodejavaforfood
2010-07-20 14:32:49
+1
A:
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.
tadej5553
2010-07-20 13:53:05
I have a table view in which the cell have text that contains multiple clickable data.
TechThirsty
2010-07-20 14:17:42
Oh, in that case this is imposibile.Create a custom table view cell, that contains the custom UILabel subclass instead of UILabel. You would probabaly want to add a ivar like owner or something, so that the UILabel subclass would know who to send the touch message to.
tadej5553
2010-07-20 14:25:08
nothing's impossible. see how he did it here http://www.three20.info/overview in the "style section"
iWasRobbed
2010-07-20 14:38:07