Roman
Roman

Reputation: 1500

Storyboard: centre text horizontally in UILabel

I know how to do it programmatically:

textLabel.textAlignment = .center

But isn't it possible to do that in storyboard? Unbelievable.
There is an appropriate property called "Content Mode: Center" in the attributes inspector, but seems it doesn't work.

Upvotes: 0

Views: 671

Answers (1)

Frankenstein
Frankenstein

Reputation: 16361

As @Sweeper has said in the comments. The UILabel has an Alignment property which you can find under the Attributes Inspector tab, set the value to Center represented by horizontally centred dashes.

Text alignment

Upvotes: 1

Related Questions