Search code examples
iphoneuitableviewcore-animation

cell animation, uitableview cell


I was downloading an Pizza pizza application for IPhone. There is very cool animation for a cell.

If you click on particular cell, it will expand down and show you more controllers.

Please look at link1 (first state ) and at link2 (second state when you are clicking on the cell)

Question : what is the right way to achieve this animation.

Please advice me on this issue. Any comments are welcomed


Solution

  • There is nothing new about this animation. Its pretty straight forward, and it will just depend on how you want to effect this change.

    For example, start off with the cells as shown in your first image. Touching a cell will call the -didSelectRowAtIndexPath, and you will need to increase the size of the cell, and provide the new cell (which is the image of the second link). Call tableView reloadData to effect this change. UseUIAnimation that will animate the cell from your first state to second state for a period of 0.5 seconds (how fast you want it to be)

    Make sure that during the animation period, your cell is NOT selectable. cell.userInteractionEnabled = NO

    You can do this with other animation frameworks, but UIAnimation should do the trick. (Refer to examples of UIAnimation if you need help with it)