UILabel with attributes / range?

Discussion in 'iOS Programming' started by Darkroom, Aug 16, 2009.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    for alignment purposes i need to create one (and only one) UILabel, but that label needs to contain different type faces and sizes. however, i've read that NSAttributedString is not available for iPhone. is it possible to have one label with different attributes some other way?
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Using the SDK, the answer is No. UILabel allows only one 'style.' The only way to get multiple styles is UIWebView.

    The ThreeTwenty classes have a styled label class that might work for you.

    http://groups.google.com/group/three20?lnk=srg
     
  3. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #3
    Assuming a compact UIWebView is inappropriate, my ideas are:

    Multiple UILabels stacked together

    Custom drawing with the UIKit String Drawing methods.

    Custom drawing with Core Graphics.
     

Share This Page