Search code examples
uitableviewnslayoutconstraintuitableviewautomaticdimension

automatic height dimensions of the table view cell is not working properly


I am building the chat app in which I am using the automatic dimensions of table view for cells but height for cell is not working properly for some cells.

enter image description here

and here is the constraints of view enter image description here

here is the screen shot of view hierarchy enter image description here


Solution

  • You need to set contentcompressionresistance(vertical) to 1000 and contenthuggingpriority (vertical) to 1000