1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Space between lines in UILable with more than one line

Discussion in 'iPhone/iPad Programming' started by johnyabu, Aug 27, 2012.

  1. johnyabu, Aug 27, 2012
    Last edited: Aug 27, 2012

    macrumors newbie

    #1
    Is it possible to define the space (leading space )between each line in the UILable when the text is warped?

    if it's not possible how can get an array of strings from the original string that represents the warp lines that i can create UIlable for each "Line" what i have the Font and the height and width of the original UILable

    then i can set the space between each line as i want
    Thanks
     
  2. macrumors 68030

    PhoneyDeveloper

    #2
    I don't think there's any way to adjust the leading or line height.

    You could use the methods in UIStringDrawing.h to figure out where the line breaks are.
     
  3. macrumors 68000

    Reason077

    #3
    There's no way to adjust the spacing between lines in UILabel, or any of the UIKit String drawing methods.

    Basically you have two options. Either:

    1. Write code to split the line manually, and draw each string yourself

    2. Or, use the Core Text API, which gives you much more precise control over text layout.
     

Share This Page