This is the scenario: I have a Table in which there are Cells with dynamic height. In each cell I have a label and a switch. When I run the App only these two can be seen but then I set the switch to true then a (hidden?) textview appears under these two elements making the height of the cell bigger.
How can I do this? Because when I try hidden elements take up place as well.
This is what I want:
Reality:
How can I do this? I tried using the new Stack View which can handle it fine, BUT NOT in a table cell....
How can I solve this?
I solved it mixing this answer: Dynamic Height Issue for UITableView Cells (Swift) for the dynamic height and then for the views that show or not I added a height constraint to the view and then on cellForRowAtIndexPath just set the constant of the constraint to 0 if you need to hide it or to your height if you show it.
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With