Cut/Copy/Paste Menu For UILabel?

Discussion in 'iPhone/iPad Programming' started by Darkroom, Nov 10, 2009.

  1. Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    is it not possible to select/copy a static UILabel?
     
  2. macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #2
    You might have to turn on user interaction and let it become the first responder.
     
  3. thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    no dice. is this normal functionality for the iPhone's select/copy to work with static UILabels? have i missed the memo?
     
  4. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    I doubt that this functionality is built into labels. You will probably need to subclass UILabel to make this work.
     
  5. thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #5
    i was about to simply use a non-editable, non-scrollable text view, but i'm unable to change the font attributes of a text view using IB. certainly anything is possible with subclassing and code, but i find the challenge more inciting than the new functionality.

    maybe apple will update UILabel to be optionally selectable/copyable for next time.
     
  6. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    No, but it can be done programatically.
     
  7. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7
    Yes you can. Select the textview and choose Fonts > Show Fonts and choose your font.

    And you're right, this should give you what you want. In fact there's no way to turn off that edit menu even if the text view is non-editable.
     
  8. thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #8
    oh perfect. now the only thing missing is the ability to vertically center the text according to the size of the text view with scrolling disabled.
     

Share This Page