0

I am creating a custom UITableViewCell with UILabel inside.

When I am setting too long text into UILabel, it overlaps bounds of the cell. Looks like I have specified all required properties of UILabel, but still failed to resolve what could be wrong.

Possibly I should configure a table or the cell?

Could you please advice the way I can fix this?

Thanks.

Lyubomyr Dutko
  • 4,486
  • 7
  • 32
  • 39

1 Answers1

1

Have you set the number of lines on the UILabel to greater than 1? The number of lines defaults to 1, and if it is set to 1 then none of the UILineBreakModes will apply.

You can set the number of lines in code as follows:

UILabel *myLabel;
myLabel.numberOfLines = 2;

You should then find your LineBreakMode setting works...

h4xxr
  • 11,385
  • 1
  • 39
  • 36