Making a phone # clickable?

Discussion in 'iOS Programming' started by nottooshabby, Feb 19, 2009.

  1. macrumors regular

    Joined:
    Jul 12, 2008
    #1
    So I know how to use openurl to make a button call a phone number or send an email, but is there a way to have a label that is a phone number be the button itself or be clickable? Do I need to make a custom invisible button behind the label that calls an ibaction function that contains the openurl command or is their a way to make the phone number look like a hyperlink so that the user would know they could click it to call the phone number? Hopefully this makes sense...
     
  2. macrumors 6502a

    bbrosemer

    Joined:
    Jan 28, 2006
    #2
    I am pretty sure it has to be a button ...
     
  3. macrumors 603

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #3
    You could try sticking the number inside a UIWebView as an HTML link.
     
  4. macrumors regular

    Joined:
    Mar 13, 2008
    #4
    you may have already found the answer by now, but if you didnt. you can either ( a ) use your label like you use an UIView to handle touch events: UILabel inherits from UIView, as an effect you have all the UIView methods available or ( b ) use a button of type "custom", set the "title" property to whatever you wanted the label to say, and use the font properties to adjust color and underlining.
     
  5. thread starter macrumors regular

    Joined:
    Jul 12, 2008
    #5
    Good call. I hadn't thought about (b). Thanks.... That should be easy enough.
     
  6. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    How do you adjust underlining with fonts? Is there a font on the iPhone that supports underlining?
     

Share This Page