Sandy_ios Sandy_ios - 4 months ago 9
Objective-C Question

Displaying on label

I want to display some text means name of any source file with extension in a label. But the width is fixed and if the name is more than the width I want the name to be displayed like "Women Que...nnaire.jpg". Is it possible to display like this . If possible please let me know.

Answer

Set following in your label object:

adjustsFontSizeToFitWidth=NO;
lineBreakMode=NSLineBreakByTruncatingMiddle;
numberOfLines=1;
Comments