Multiline UILabel not working in UITableViewCell?

311 views Asked by At

I'm trying to use a multiline UILabel inside my custom UITableViewCell. Unfortunately the frame of the label is not correct, so therefore it's only showing one single line.

I've also set the numberOfLines and lineBreakMode properties.

cell.bodyLabel.numberOfLines = 0;
cell.bodyLabel.lineBreakMode = NSLineBreakByCharWrapping;

I'm also calculating the correct height of the cell, in heightForRowAtIndexPath.

Set up in Storyboard and custom class: http://imgur.com/Dt35nIS

Settings of label in Storyboard: http://imgur.com/ZHKv8yt, https://i.stack.imgur.com/8MGVJ.jpg

EDIT

It turned out that the issue has something to do with Auto Layout, I added some constraints, now most of the cells are fine, but there are still a fews, where some Labels collapses with others. What do I need to check in this cases?

0

There are 0 answers