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.
Asked
Active
Viewed 194 times
-1
-
1check your constraints – SPatel Dec 20 '19 at 04:38
-
you may not need to return fixed hight ' – SPatel Dec 20 '19 at 04:38
-
Yes.. you don't need to specify the height. If your autolayout constraints are correct, then the tableview will automatically set the correct height – Anil Arigela Dec 20 '19 at 06:50
1 Answers
1
You need to set height for row
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 100.0;//Choose your custom row height
}

Kamlesh Shingarakhiya
- 2,757
- 2
- 16
- 34