SevenBits
SevenBits

Reputation: 2874

Enable word wrap automatically on labels

In iOS, you can have a UILabel and set its numberOfLines property to zero and it will automatically word wrap to fit content. Is there any way to do this in OS X using Cocoa? OS X uses NSTextField for labels, and there is no equivalent property or method there. Is it possible to do this in OS X?

Note: I'm using auto layout, so it would be great if there is a solution to works with it so the other, nearby views can be resized as needed.

Upvotes: 1

Views: 134

Answers (1)

Daniyar
Daniyar

Reputation: 3003

You can use Multiline Label for this purpose. Find this control (another NSTextField) in the Object Library. Or select common Label control and change its Layout property to Wraps-value.

Upvotes: 1

Related Questions