swiftuitableviewnstablecellview

Random table view cell height is not working perfectly


I am designing a chat app in which I am using the UITableViewAutomaticDimension property of table view when I am setting the label lines to 6 then all cells height is according to the text which label contains but when I increase the number of lines for label then some cells have extra height. Even when scrolling it then cell height again changed.You can check the image so that you can understand it easily thanks. enter image description here


Solution

    1. You need to give label constraints from top and bottom, rather than center vertically.
    2. Give vertical content hugging priority