samir samir - 3 months ago 4x
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.


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