Table view cell expandable iOS?

You can achieve this through the use of custom cells. Create two custom cells, one for the normal row and other for the expanded row. When the user touches a particular cell, you can record it's indexPath and reload the tableView.

While reloading you can change the height of this selected row using the code that you've just posted(increasing the height of only the selected cell). This would give an effect of expanding cell.

DidSelectRowAtIndexPath would be called for the selected cell. You may set up a flag here, which can be referred again by the UITableViewDatSource methods, when a tableView reloadData is done. – Vin Apr 5 at 10:25 On which way the code knows which custom cell should be selected?

Do I declare this in the didSelectRowAtIndexPath? And on which way? – peter Apr 5 at 10:26 when the cellForRowAtIndexPath is called again after tableView reload, you can check, using the flag for which cell it was called.

You can then redraw the cell with new custom cell, leaving the others like before. – Vin Apr 5 at 10:28 Okay! I starting to get it, will try this.Do you by chance also know how I can retract the cell once it is tapped again?

– peter Apr 5 at 11:15 Once the user touches another cell, the whole process happens again. This time a new cell expands and it looks like the already expanded one is contracting. Try it out!

– Vin Apr 5 at 11:20.

Peter I have done something like inserting new custom cell hope this may be helpful I have posted link here kshitizghimire.com.np/insert-customuitab... test it if it is helpful good luck.

Sound interesting but I don't know if this will get the layout as I want to. Does the extra row not really looks like just another row instead of details? – peter Apr 5 at 11:14 you can add extra row as you like just create custom cell , if you want different custom cell per row your need to create different custom cell and load different custom cell for different row as you required – Kshitiz Ghimire Apr 5 at 11:32.

I have put together a bare bones tutorial about this: roostersoftstudios.com/site/?p=105 I believe this is what you are talking about and it contains a working iphone project. I hope this helps and let me know if you have any questions -Ryan.

I want a table view with only cels, and when you click on a cell it should expand and show more info of the clicked cell. I've seen quite some topics on this, but the most of them are linking to Table View Animations and Gestures on the apple developer page. Which does it in a different way.

They use header sections, but I want to use the cell which is expandable for layout reasons. When I Click on the cell, the cell is expanded but the info in that cell stays the same. Also the heigth of the cell when expanded should be related to the amount of text in the details.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions