How to create expandable table view in ios?

1.1k Views Asked by At

On click of table cell it will dynamically increase the label height and if user click on another cell previsoly opened cell will collapse and expand selected cell.I was try hard for this bt label text is not working well.I want increase the height of cell.exa- click on question cell it will expand the answer

1

There are 1 best solutions below

6
On BEST ANSWER

Connect UITableViewCell to the code behind, have a state for that cell and on didSelectRowAtIndexPath change cell height to whatever value you want. Regarding of the state of the cell ( you can do this by checking its height as well ) shrink or expand the cell.

You can do this by adding another cell below "question" cell and make it visible or hidden on click as well.