Vorotnyak_Nazar
Vorotnyak_Nazar

Reputation: 914

iOS, TableViewCell, Update Height of a cell dynamically

MenuTableView.RowHeight = UITableView.AutomaticDimension;
MenuTableView.EstimatedRowHeight = 100;

For a cell I use AutoLayout. Everything is pinned to everything. It properly calculates size, but when I try to change dynamically height constraint of the textfield to 0 for example cell isn't updating its height(doesn't shrink) as it would do initially if I changed the same constraint in the editor.

All constraint changes work good if they are done in GetCell but not when later dynamically

How to update cell dynamically? Or how to trigger cell height recalculating based on views and constrains?

Upvotes: 0

Views: 149

Answers (1)

dduyduong
dduyduong

Reputation: 122

To update cell, use tableView.reloadRows(at:with) method after you have changed something in that cell

Upvotes: 1

Related Questions