samir samir - 1 year ago 156
iOS Question

UILabel configuration

I have a text like this :"My text is blabla blabla, lala lala "I would like to have my text in my UILabel like this : "My text is ...lala" , how i can configure my UILabel to have this ?

Thanks for your answer.

Answer Source

The word you are looking for is "elipsis" ;)

Set the following properties:

label.adjustsFontSizeToFitWidth = NO;
label.lineBreakMode = UILineBreakModeTailTruncation;

You can also set these properties in interface builder.

Example stolen from here: Getting UILabel to produce an ellipsis rather then shrinking the font

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download