Search code examples
iosobjective-cuilabel

How to add dots to UILabel if text does not fit frame


I have a cell with multiline UILabels, but when the text's label does not fit the frame, no dots are shown. How can I fix this?


Solution

  • Have you tried this?

    Prior Swift 5:

    yourLabel.adjustsFontSizeToFitWidth = NO;
    yourLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    

    Swift 5:

    yourLabel.adjustsFontSizeToFitWidth = false
    yourLabel.lineBreakMode = .byTruncatingTail
    

    Prior iOS6 use UILineBreakModeTailTruncation