Auto Resizing of the tableView Cells is not working with multiline labels in its contentView

651 views Asked by At

I have tableviewController with custom cell. In each cell I want to display multi-line labels. So, I added these labels to content view of the cell and set all the constraints.

The cells should resize automatically according to height of the multi-line labels.But the labels are overflowing the cells without the cell height being changed.Initially tried with following code in view did load of tableView Controller

    tableView.estimatedRowHeight = 100
    tableView.rowHeight = UITableViewAutomaticDimension

I was not successful. I have even referred some of the tutorials, but no use. I am creating everything programatically in my app. There is no involvement of storyBoard in case of this tableView Controller

0

There are 0 answers