SaintTail
SaintTail

Reputation: 6470

UILabel doesn't show text properly

I have UILabel in interface builder like this (creating text and use Cmd + =)

enter image description here

but when i run the program on emulator or real device, it looks like this

enter image description here

the answer from here can solve my issue but it isn't the best way because i don't want to create all my label as an IBOutlet for calling sizeToFit and i also don't want to scale down my text.

is there any way to display text in the device as it shows in interface builder without additional code or configuration?

Thanks

Upvotes: 1

Views: 457

Answers (2)

Luis E. Prado
Luis E. Prado

Reputation: 2151

Select your label in the interface builder, and then in the utility area found on the right hand side, go to the "Size Inspector", look for this icon --> Size Inspector In there you will see options to set your label's origin, width and height

Increase the "width" of your label and that should fix your problem

Upvotes: 1

BlueBear
BlueBear

Reputation: 7639

If you're just strictly not wanting to do any of it in code, simply press Editor -> Size to Fit Content when you have the label selected in IB.

Upvotes: 1

Related Questions