if you just want to capture the touch event, you can do something like this
(in Obj-C, but same idea applies to MT)

http://stackoverflow.com/questions/3169798/handling-touch-event-in-uilabel-and-hooking-it-up-to-an-ibaction


On Wed, Jun 13, 2012 at 11:29 AM, Chris_M <[email protected]> wrote:

>
> I hope this is a simple question -- I looked but didn't find a MonoTouch
> oriented answer, although surely this has come up before.
>
> Anyway, I'm displaying text data from a database in a UIViewController (I
> have reasons for not using a UITableView to display the data). I'm using
> UILabels and it's all going swimmingly and looks great, but I have a few
> fields that are URLs. My stakeholders, quite reasonably, would like for the
> user to be able to tap on those URLs and have the page open in a webview.
>
> So my question is: How can I make a UILabel function as a button? Or is
> there a way I can dynamically create a UIButton programmatically from a
> text
> field without using an image? (I've built this view entirely
> programmatically, so I'm looking for answers that avoid using
> Xcode/Interface Builder.)
>
>
> --Chris
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/How-to-use-a-UILabel-as-a-button-tp4655352.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to