Reputation: 4844
I'm using Auto Layout for my UITableView
and it's custom cells. One of these cells has a UIStackView
to which I add and remove arranged subviews, however, when its arranged subviews changes the cell itself does not resize.
Calling the reloadData()
method is a fix for this problem, however, I only want to update the one cell that changes.
When I try calling reloadRowsAtIndexPaths(_:withRowAnimation:)
however, it only updates to show the previous change on the arranged subviews. So for example, if I add one arranged subview, say a red one, then nothing appears to happen (even though the subviews are added when I check), then adding a second causes the cell to reload but only update to show the previous red arranged subview that was added and so forth.
Is there any way of forcing specific cells to layout in the UITableView
?
Update: Here is a link to an example project showing the issue:
Upvotes: 2
Views: 1278
Reputation: 4844
It seems the answer posted here works. I've opted for the non-animated version of the answer but both seem to work.
Upvotes: 1