I am trying to set the UITableViewCell height based on what is in the cell (Primarily the image). It looks fine on an iPhone 7 Plus, however any smaller devices produce something similar to this.
My code in MainViewController
:
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
What am I doing wrong? I have the height and width constraints set to 'Greater or Equal to' 200. The height and width of the UIImageView on the Storyboard are 370x370