0

So I have a custom table view cell and I want a label to be resized based on the text in it. I've already tried doing this in the cellForRowAtIndexPath method-

        cell.titleLabel.adjustsFontSizeToFitWidth = YES;
        cell.titleLabel.numberOfLines = 1;
        [cell.titleLabel setMinimumScaleFactor:8.0/[UIFont labelFontSize]];

I also tried setting minimum scale factor and minimum font size in IB...but the label font doesn't resize.

The case I want to take care of is the case where the text in the label is larger than the phone width and so I want to resize when that happens.

What's going wrong/How do I achieve that?

Prince Agrawal
  • 3,619
  • 3
  • 26
  • 41
praks5432
  • 7,246
  • 32
  • 91
  • 156

0 Answers0