Search code examples
objective-cios5uitableviewuilabel

Custom cell label wont wordwrap


I created a custom UITableViewCell which is the same as the Left Detail cell but instead of a detailLabel it has a UITextField I matched ALL properties between the label in my custom cell and the label for the Left Detail cell however it will not word wrap. It will display the first word then instead of wrapping it just cuts the rest off without truncating. I am guessing that it is word wrapping but instead of making the label height bigger it is keep it the same as a one line label.

I have

  • label lines set to 0
  • line breaks set to word wrap
  • View autosizing set to the same as Left Detail

I did this in IB so I was able to match every setting. Anyone know how to make the custom labels for cells auto wrap?

EDIT:

To be clear I am wanting the custom label to word wrap not the textfield.


Solution

  • I ended up making the label the size of the cell instead of being static. This allowed it to wrap.