Search code examples
iosswiftuitableviewxcode11swift5

UITableView Cells not showing properly


I've made a table view, and I have a prototype cell that has a height of 100, which I set in the IB. However the cell displays as the original cell height that the prototype cell is set to by default. It should be noted that the table view is nested in a UIContainerView, not sure if that's important, but thought it could have to do with something.

Storyboard (in Xcode) enter image description here

Simulator enter image description here


Solution

  • You need to set height for row

    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 100.0;//Choose your custom row height
    }