iOS multiline label in Interface builder

Samuli Lehtonen picture Samuli Lehtonen · Jul 2, 2011 · Viewed 95.9k times · Source

How can I make a multiline UILabel in interface builder for iOS? I tried the UITextView but it didn't quite suit my needs.

How can I add multiline (text) in label?

Answer

akashivskyy picture akashivskyy · Jul 2, 2011

You can use numberOfLines property which defines maximum number of lines a label can have. By default, it's 1. Setting it to 0 means the label will have unlimited lines.

You can do it in code:

textLabel.numberOfLines = 5 // for example

Or in Interface Builder: