Search code examples
iphoneuitableviewrownsindexpath

How use summery element for label in cell of table view?


I have label in my custom cell. That cell i have display with a table view. Now i have problem is that when text of label is more wider than cell width then text cross cell width. So how summarize that text so that after a sufficient length text show .... How do that? Thanks in advance..


Solution

  • If you have only one line, you can also use

    label.adjustsFontSizeToFitWidth = YES;
    

    to reduce the size of the font to fit the text. This will work as long as the necessary font size is not less than the label's minimumFontSize property.