How to implement UILabel line spacing using xib?

IKKA picture IKKA · Jul 18, 2014 · Viewed 10.2k times · Source

I want to align a UILabel's text vertically with line spacing via xib in iOS, for example:

 hello,
 how are
 you?

Please help me.

Answer

IKKA picture IKKA · Jul 18, 2014

Yes it is possible to adjust line spacing via xib. Click on UIlabel on xib,then change ‘text’ property type to ’Attributed’,then go through following images. Then enter new line(press ctrl-return shortcut key)and keep cursor in between two lines then adjust ‘line’ property and ‘Max Height’ property you want. My UILael text is "Hello,how are you?"

enter image description here