user10021033
user10021033

Reputation:

TableViewCell not displays the height I set as a constraint

I managed to get this work in the past but now I cannot remember how I did it. I have a UITableView with a dynamic cell and in it, I have an UIView with a height of 174 as a constraint. However, after running the app, it displays the UIView with less height than I defined and also I am getting this error: Warning once only: Detected a case where constraints ambiguously suggest a height of zero for tableviewcell cell's. We're considering the collapse unintentional and using standard height instead:

enter image description here

Those are the constraints I have in the UIView:

enter image description here

I am not able to find a fix for this.

Upvotes: 0

Views: 93

Answers (1)

Kathiresan Murugan
Kathiresan Murugan

Reputation: 2962

Use this datasource

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 178
}

Upvotes: 2

Related Questions