PDA

View Full Version : Space between lines in UILable with more than one line




johnyabu
Aug 27, 2012, 04:08 PM
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



PhoneyDeveloper
Aug 27, 2012, 05:54 PM
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.

Reason077
Aug 27, 2012, 09:13 PM
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.