How to expand tablecell with new content without using reloadRowsAtIndex?
Hi, tried posting this question on some other forums with no success so im hoping some advanced users might have a solution.
I am trying create an accordion type of uitableviewcell that, when the user selects the cell, it expands to display a detailed view with a textfield and some other labels inline similar to how the digg app works. I initially tried replacing the current tablecell with a new customcell in cellForRowAtIndex by calling reloadRowsAtIndex which works fine, however the animation does not look the way i want as you can visually see the cell being reloaded either from the top, bottom, left, etc. depending on what animation style you choose.
If you look at the digg app and others who have done this it seems that they arent replacing the current cell but instead expanding the cell
Does anyone have any ideas how to accomplish a similar effect?
I did find out that by calling [tableView beginUpdates] and [tableView endUpdates] right after one another the table will reset its geometry and this animates the cell to its new row height using the exact animation effect i am looking for. The problem is that i am not sure where to put the code that adds the additional textfield, labels, etc to the expanded cell??? I cant put it in cellForRowAtIndex because while [tableView beginUpdates] and [tableView endUpdates] does redo the tables geometry it does NOT call cellForRowAtIndex.
Any ideas, this has been driving me crazy for the past few days and i really want to move on to something else.
Last edited by s.newave; 06-22-2010 at 07:15 PM.
|