Space between lines in UILable with more than one line

Discussion in 'iOS Programming' started by johnyabu, Aug 27, 2012.

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

    johnyabu macrumors newbie

    Aug 27, 2012
    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
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    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. Reason077 macrumors 68020


    Aug 14, 2007
    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